can-stream
Create useful stream methods from a minimal stream wrapper implementation.
canStream(streamImplementation)
Exports a function that takes a StreamImplementation (like can-stream-kefir) and uses it internally to provide several useful string methods.
Parameters
- streamImplementation
{StreamImplementation}
:A StreamImplementation object that implements the
toStream
andtoCompute
methods for a stream library.
Returns
{streamInterface()}
:
An object that has the following methods:
- .toStream(observable, propAndOrEvent[,event])
- .toStreamFromProperty(property)
- .toStreamFromEvent(property)
- .toCompute(makeStream(setStream), context):compute
Use
See can-stream-kefir for an example.