callbag-create
Creates a new Callbag given an optional producer that dictates how to emit values and complete the Callbag.
npm install callbag-create
Examples
With a Producer
const create = ;const forEach = ;const pipe = ; ;// logs 'a', 'b', then completes.// Calling next('c') does nothing since done() was called and terminated the callbag
With a Producer returning a clean-up logic
const create = ;const forEach = ;const pipe = ; const unsubscribe = ; ;// logs nothing since it was unsubscribed before emitting and the timeout is cleared
With a Noop Producer
Equivalent to xstream and RxJs never(). Never emits the completion message.
const create = ;const forEach = ;const pipe = ; ;
Without a Producer
Equivalent to xstream and RxJs empty(). Emits no value and immediatelly emits the completion message.
const create = ;const subscribe = ;const pipe = ; ;