asyncplify
Version:
FRP (functional reactive programming) library for Javascript
16 lines (15 loc) • 367 B
JavaScript
function Trigger(source, target) {
this.target = target;
this.source = null;
target.trigger = this;
source._subscribe(this);
}
Trigger.prototype = {
emit: function (value) {
this.target.triggerEmit(value);
},
end: noop,
setState: function (state) {
if (this.source) this.source.setState(state);
}
};