Skip to content

Commit

Permalink
fix: run recompute within runloop
Browse files Browse the repository at this point in the history
I ran into this bug

emberjs/ember.js#14774

so I followed the suggestion and wrapped the `recompute` in a runloop
  • Loading branch information
alexlafroscia committed Jan 26, 2019
1 parent 793be78 commit 328d817
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addon/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Helper from "@ember/component/helper";
import { join } from "@ember/runloop";

function arraysMatch(first, second) {
return first.reduce(
Expand Down Expand Up @@ -30,7 +31,10 @@ export default class BaseSubscriptionHelper extends Helper {

emit(value) {
this.lastValue = value;
this.recompute();

join(() => {
this.recompute();
});
}

_parametersHaveChanged(positionalParams, hashParams) {
Expand Down

0 comments on commit 328d817

Please sign in to comment.