Skip to content
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.
/ flyd-bufferCount Public archive

bufferCount stream implementation for flyd

Notifications You must be signed in to change notification settings

bortexz/flyd-bufferCount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flyd-debounceTime

Build Status

bufferCount implementation for flyd streams.

Buffers the source stream, and emits when the buffer is size bufferSize, and starts a new buffer each bufferEvery.

(Number [Number] Stream) -> Stream Buffer

a:                    {1-2-3------4----5---6-----7---}
bufferCount(3, 2, a): {----.-----------.---------.---}
                           [1,2,3]     [3,4,5]   [5,6,7]

Usage

var stream$ = flyd.strem()
var buffer32$ = bufferCount(3, 2, stream$)
stream$(1)
assert.deepEqual(buffer32$(), undefined)
stream$(2)(3)
assert.deepEqual(buffer32$(), [1, 2, 3])
stream$(4)(5)
assert.deepEqual(buffer32$(), [3, 4, 5])

About

bufferCount stream implementation for flyd

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published