Skip to content

Commit

Permalink
bind 'this' for getState and subscribe in Store constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
dermeck committed Oct 14, 2022
1 parent 95ff156 commit a7b5260
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/store/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ class Store {
});

this.dispatch = this.dispatch.bind(this); // add this context to dispatch
this.getState = this.getState.bind(this); // add this context to getState
this.subscribe = this.subscribe.bind(this); // add this context to subscribe
}

/**
Expand Down

0 comments on commit a7b5260

Please sign in to comment.