1.0.6 • Published 9 years ago

stream-debounce v1.0.6

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

stream-debounce

DEPRECATION NOTICE

This module has been renamed to debounce-stream.

Example

var events = require('dom-delegation-stream')
  , values = require('dom-value-object-stream')
  , debounce = require('stream-debounce')

events(document.querySelector('[rel=inputs]'), 'input')
  .pipe(values()) // values is a stream that progressively updates on user input
  .pipe(debounce(500)) // emit only after a pause of 500 ms
  .on('data', function(data) {
    console.log(data) // the data after a user has stopped typing for 500 ms
  })

API

  • debounce([milliseconds] [, immediate]) - Create a new debounce duplex stream
    • milliseconds - Integer. The number of milliseconds to debounce the stream. Defaults to 100
    • immediate - Boolean. If true, the debounced function will call immediately, rather than at the end of input. Default is false.

Returns a duplex stream that accepts values on one end, and emits the debounced values on the other.

License

MIT. See LICENSE for details.

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago