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