-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
bind proper store context in connectAdvanced and the Subscription util #465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
If this is important for some 3rd party libraries, could you also add a test that verifies we're doing the right thing? |
@@ -159,7 +159,8 @@ export default function connectAdvanced( | |||
} | |||
|
|||
initSelector() { | |||
const { dispatch, getState } = this.store | |||
const { dispatch } = this.store | |||
let getState = this.store.getState.bind(this.store) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Please use a const here since this var will not be modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌🏾 will do.
@jimbolla will do as soon as I get back to my computer. |
Added a test which uses a generic I also cached a bound version of |
Out of curiosity, how does the org process of publishing/updating the When y'all are good with this, I'd like to update our beta extension right away to solve an issue we have with our users, so just trying to get a time frame there. |
Can someone assign this to the 5.0 milestone? |
Thanks! I'll probably publish another release (as beta) once we get the fix for #457 in. |
bind proper store context in connectAdvanced and the Subscription util
Addresses #464.
The issue explains this fix pretty well, but basically in the previous version of
connect
the store's context was respected when callinggetState
orsubscribe
. I move that we should have that be respected in this version as well.Also left you a quick video:
https://www.useloom.com/share/2093c4a0652111e6a1ffdd04f7a207b4