MCPcopy Create free account
hub / github.com/microsoft/SandDance / EventStream

Function EventStream

docs/tests/v2/es6/js/sanddance.js:77293–77299  ·  view source on GitHub ↗

* Models an event stream. * @constructor * @param {function(Object, number): boolean} [filter] - Filter predicate. * Events pass through when truthy, events are suppressed when falsy. * @param {function(Object): *} [apply] - Applied to input events to produce * new event values. * @param {

(filter, apply, receive)

Source from the content-addressed store, hash-verified

77291 */
77292
77293function EventStream(filter, apply, receive) {
77294 this.id = ++STREAM_ID;
77295 this.value = null;
77296 if (receive) this.receive = receive;
77297 if (filter) this._filter = filter;
77298 if (apply) this._apply = apply;
77299}
77300/**
77301 * Creates a new event stream instance with the provided
77302 * (optional) filter, apply and receive functions.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected