deko-debounce
v1.0.0
Published
Function debounce decorator for deko.
Downloads
4
Readme
deko-debounce
debounce decorator for deko.
const deko = require('deko')
const debounce = require('deko-debounce')
class WorldClass {
constructor() {
deko(this)
}
static $$ontypedDebounced() {
return [ debounce({ wait: 50 }) ]
} ontypedDebounced(e) {
// do stuff here
}
}
const worldClass = new WorldClass()
for (var i = 0; i < 5; i++) {
worldClass.ontypedDebounced()
}
// ontypedDebounced only executes one time after 50ms elapsed
Installation
npm install deko-debounce
API
debounce
Creates a debounce decorator to be used with deko
Parameters
$0
Object config
Returns Object debounceDecorator to be used with deko
License
MIT