Skip to content

Commit

Permalink
Add a tip for changing the prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
hopsoft committed Mar 17, 2024
1 parent 918e567 commit 15f7d0c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,13 @@ debounced.unregister(['click', 'input', 'keydown'])

### Debounced Event Prefix

> [!IMPORTANT]
> Setting the prefix needs to be done before invoking `initialize` or `register[Event]`.
You can change the prefix of the debounced event names.

```js
debounced.prefix = 'custom-prefix'
debounced.prefix = 'custom-prefix' // must be set before invoking initialize
debounced.initialize()
document.addEventListener('custom-prefix:click', event => { ... })
```
Expand Down

0 comments on commit 15f7d0c

Please sign in to comment.