https://github.com/regular/pull-debounce
  
  
    a debouncing pull-stream 
    https://github.com/regular/pull-debounce
  
debounce pull-stream stream
        Last synced: 8 months ago 
        JSON representation
    
a debouncing pull-stream
- Host: GitHub
- URL: https://github.com/regular/pull-debounce
- Owner: regular
- Created: 2015-09-22T15:42:12.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-19T16:44:18.000Z (over 8 years ago)
- Last Synced: 2024-04-27T00:24:53.123Z (over 1 year ago)
- Topics: debounce, pull-stream, stream
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- 
            Metadata Files:
            - Readme: readme.md
 
Awesome Lists containing this project
README
          # pull-debounce
[](https://nodei.co/npm/pull-debounce/)
debounce for pull-streams
## Example
``` js
var pull = require('pull-stream')
var debounce = require('pull-debounce')
function timedSource(data) {
  return pull(
    pull.values(data),
    pull.asyncMap(function(item, cb) {
      setTimeout(function() {
        cb(null, item[1])
      }, item[0]);
    })
  )
}
pull(
  timedSource([
    [0,   0],
    [250, 1],
    [10,  2],
    [250, 3],
    [2000,4],
    [10,  5]
  ]),
  debounce(200),
  pull.log()
)
// => 0,2,3,5
```
## Credits
Many thanks to [@amsross](https://github.com/amsross), who provided valuable feedback, bug reports and code
## License
MIT