on master help sign in
Fix bug in `sampleOn`.
commit9197f15f1add07a2a25dcc173f46c954a195eba9 authorevancz <info@elm-lang.org> dateThu 13 Sep 2012, 12:25 (14 years ago) parentbcfdf66
1 file changed+5−3
core-js/runtime/Dispatcher.js+5−3
core-js/runtime/Dispatcher.js+5−3
@@ -95,14 +95,16 @@ var Elm = function() {
9595 this.value = s2.value;
9696 this.kids = [];
9797 this.count = 0;
98+ this.changed = false;
9899
99100 this.recv = function(timestep, changed, parentID) {
100− var chng = changed && parentID === s1.id;
101− if (chng) { this.value = s2.value; }
101+ if (parentID === s1.id) this.changed = changed;
102102 this.count += 1;
103103 if (this.count == 2) {
104− send(this, timestep, chng);
104+ if (this.changed) { this.value = s2.value; }
105+ send(this, timestep, this.changed);
105106 this.count = 0;
107+ this.changed = false;
106108 }
107109 };
108110 s1.kids.push(this);