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

Function EventStream

docs/app/js/sanddance-app.js:107713–107719  ·  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 {

(filter1, apply, receive)

Source from the content-addressed store, hash-verified

107711 * @param {function(Object)} [receive] - Event callback function to invoke
107712 * upon receipt of a new event. Use to override standard event processing.
107713 */ function EventStream(filter1, apply, receive) {
107714 this.id = ++STREAM_ID;
107715 this.value = null;
107716 if (receive) this.receive = receive;
107717 if (filter1) this._filter = filter1;
107718 if (apply) this._apply = apply;
107719}
107720/**
107721 * Creates a new event stream instance with the provided
107722 * (optional) filter, apply and receive functions.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected