Skip to content

Commit

Permalink
Added test to confirm #1148 is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed Feb 27, 2018
1 parent 8c2f648 commit ea8f603
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/base/reaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

0 comments on commit ea8f603

Please sign in to comment.