Lossless rate limiter for most.js
npm install most-limitermost-limiter # 
Lossless rate limiter for most.js.
Unlike most.debounce or most.throttle, with most-limiter, each event gets through, unless the internal buffer overrides.
Using npm:
``console`
$ npm install --save most-limiter
In Node.js:
`js`
const limiter = require('most-limiter');
stream.thru(limiter(interval [, capacity = 1000])) -> Stream
``
stream: -a-b---cdef----->
stream.thru(limiter(100)): -a-b---c-d-e-f-->
- interval is the minimum time interval between events, in ms.capacity
- is the maximum size of the internal buffer, overrides leads to an error.
`js
const most = require('most');
const limiter = require('most-limiter');
// Logs
// 1
// 2 (after 500ms)
// 3 (after 500ms more)
most.iterate(x => x + 1, 0)
.take(3) // 3 first numbers
.thru(limiter(500)) // Limit to on event every 500ms
.observe(x => console.log(x))
``