Sha256: a14c5b8dbed48352786a663a0aa666655963a37b2267f6e0093a8b82b10a2dc6

Contents?: true

Size: 373 Bytes

Versions: 71

Compression:

Stored size: 373 Bytes

Contents

import { Controller } from '@hotwired/stimulus'

// Connects to data-controller="clear-timeout"
export default class extends Controller {
  connect () {
    this.element.dataset.timeoutId.split(',').forEach((el) => {
      const timeoutId = parseInt(el)
      clearTimeout(timeoutId)
      console.log(`clearedTimeout: ${timeoutId}`)
    })
    this.element.remove()
  }
}

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
pg_rails-7.5.7 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.5.6 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.5.5 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.5.4 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.5.3 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.5.2 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.5.1 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.5.0 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.4.3 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.4.2 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.4.1 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.4.0 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.3.5 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.3.4 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.3.3 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.3.2 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.3.1 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.3.0 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.2.3 pg_layout/app/javascript/controllers/clear_timeout_controller.js
pg_rails-7.2.2 pg_layout/app/javascript/controllers/clear_timeout_controller.js