From 328d817ec31affcb93ce8788886673a1e9d746c9 Mon Sep 17 00:00:00 2001 From: Alex LaFroscia Date: Sat, 26 Jan 2019 01:54:13 -0800 Subject: [PATCH] fix: run `recompute` within runloop I ran into this bug https://github.com/emberjs/ember.js/issues/14774 so I followed the suggestion and wrapped the `recompute` in a runloop --- addon/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addon/index.js b/addon/index.js index 23a8b16..be2d950 100644 --- a/addon/index.js +++ b/addon/index.js @@ -1,4 +1,5 @@ import Helper from "@ember/component/helper"; +import { join } from "@ember/runloop"; function arraysMatch(first, second) { return first.reduce( @@ -30,7 +31,10 @@ export default class BaseSubscriptionHelper extends Helper { emit(value) { this.lastValue = value; - this.recompute(); + + join(() => { + this.recompute(); + }); } _parametersHaveChanged(positionalParams, hashParams) {