pull-buffer-until
Group incoming items until either a condition is met or no new items arrived for a while. This is great for processing data in batches while still retaining realtime-ness. Like pull-group, but with a timeout, and like pull-debounce, but with collecting intermediate items.
Example
const pull =const bufferUntil ={return}/* =>[5,6,7][8,9,10][11][15,16,17][18,19,20]
API
bufferUntil([condition], [opts])
condition
is called with the array of bufered items. If it returns a truthy value, the buffer is flushed (emitted downstream).opts
timeout
: If no new items arrive within the specified number of milliseconds, the buffer is flushed.
License
MIT