From ea8f60331833f91aa7fd665cbae2f26b90fef06a Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Tue, 27 Feb 2018 11:32:13 +0100 Subject: [PATCH] Added test to confirm #1148 is fixed --- test/base/reaction.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/base/reaction.js b/test/base/reaction.js index 1ae042cb6..5c8326f68 100644 --- a/test/base/reaction.js +++ b/test/base/reaction.js @@ -408,3 +408,18 @@ test("reaction equals function only invoked when necessary", () => { disposeReaction() }) }) + +test("issue #1148", () => { + const a = mobx.observable.box(1) + let called = 0 + const dispose = reaction( + () => this.a, + () => { + called++ + }, + { delay: 1 } + ) + a.set(2) + dispose() + expect(called).toBe(0) +})