deko-debounce
Function debounce decorator for deko.
Last updated 3 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install deko-debounce 
SYNC missed versions from official npm registry.

deko-debounce build status

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
    • $0.wait Number number of milliseconds for which to postpone executions
    • $0.immediate Boolean if true causes debounce to trigger the function on the leading edge instead of the trailing edge of the wait interval

Returns Object debounceDecorator to be used with deko

License

MIT

Current Tags

  • 1.0.0                                ...           latest (3 years ago)

2 Versions

  • 1.0.0                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |