diff --git a/src/Cat.js b/src/Cat.js index a041803..f419851 100644 --- a/src/Cat.js +++ b/src/Cat.js @@ -57,9 +57,13 @@ const methods = { dispose() { debug('dispose all the things'); - this.stores.forEach((store) => { + this.stores.forEach(store => { store.dispose(); }); + + this.actions.forEach(action => { + action.dispose(); + }); } }; diff --git a/test/cat.js b/test/cat.js index e234ad5..96b22f9 100644 --- a/test/cat.js +++ b/test/cat.js @@ -195,11 +195,14 @@ describe('Cat', function() { // add observer to store // in turn store observers actions catStore.subscribe(() => {}); - catStore.hasObservers().should.equal.true; - catActions.doAction.hasObservers().should.equal.true; + catStore.hasObservers().should.be.true; + catActions.doAction.subscribe(() => {}); + + catActions.doAction.hasObservers().should.be.true; cat.dispose(); - catStore.hasObservers().should.equal.false; - catActions.doAction.hasObservers().should.equal.false; + + catStore.hasObservers().should.be.false; + catActions.doAction.hasObservers().should.equal(false); }); }); });