* 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)
| 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. |
nothing calls this directly
no outgoing calls
no test coverage detected