Skip to content

Commit

Permalink
[resolves #405] Remove payload parameter in BaseStore.emitChange
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ridgway committed Mar 28, 2016
1 parent ce8937e commit 52e513b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 2 additions & 3 deletions packages/dispatchr/addons/BaseStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ BaseStore.prototype.shouldDehydrate = function shouldDehydrate() {
/**
* Emit a change event
* @method emitChange
* @param {*} param=this
*/
BaseStore.prototype.emitChange = function emitChange(param) {
BaseStore.prototype.emitChange = function emitChange() {
this._hasChanged = true;
this.emit(CHANGE_EVENT, param || this);
this.emit(CHANGE_EVENT, this);
};

module.exports = BaseStore;
8 changes: 2 additions & 6 deletions packages/dispatchr/tests/unit/addons/BaseStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ describe('BaseStore', function () {

it('allows listening for changes', function (done) {
var store = new BaseStore(dispatcherMock);
var payloadMock = {
foo: 'bar'
};
store.addChangeListener(function (payload) {
expect(payload.foo).to.equal('bar');
store.addChangeListener(function () {
done();
});
store.emitChange(payloadMock);
store.emitChange();
});
});

0 comments on commit 52e513b

Please sign in to comment.