Sha256: 732de0b582b614e3749d332e641f731e9255d429b4b41534f67ca9cd01383e24
Contents?: true
Size: 502 Bytes
Versions: 12
Compression:
Stored size: 502 Bytes
Contents
import { Controller } from "@hotwired/stimulus" import { debounce } from "helpers" export default class extends Controller { static values = { debounceTimeout: { type: Number, default: 300 } } initialize() { this.debouncedSubmit = debounce(this.debouncedSubmit.bind(this), this.debounceTimeoutValue) } submit(event) { const form = event.target.form || event.target.closest("form") if (form) form.requestSubmit() } debouncedSubmit(event) { this.submit(event) } }
Version data entries
12 entries across 12 versions & 1 rubygems