Skip to content

Commit

Permalink
Merge pull request #289 from dermeck/state-undefined-rr8
Browse files Browse the repository at this point in the history
bind 'this' for getState and subscribe in Store constructor
  • Loading branch information
SidneyNemzer authored Jun 19, 2024
2 parents 95ff156 + a7b5260 commit 091f3bc
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 091f3bc

Please sign in to comment.