-
Notifications
You must be signed in to change notification settings - Fork 109
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
Fix useHookstate store switchover #409
base: master
Are you sure you want to change the base?
Conversation
afb51ed
to
f506584
Compare
ac337e2
to
139b9e2
Compare
|
||
rerender({ source: newStore }); | ||
|
||
expect(renderTimes).toBe(3); |
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.
could you please extend the tests to make sure we can do state set action after the store is reinitialized? same for other tests you put.
@@ -1056,7 +1066,8 @@ class Store implements Subscribable { | |||
set(path: Path, value: StateValueAtPath): SetActionDescriptor { | |||
if (this.edition < 0) { | |||
// TODO convert to console log |
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.
maybe remove TODO comment? and update web docs for this error code?
Hi @speigg ... could you please let me know if you are planning to address my comments? |
Hi @avkonst I'd be happy to address your comments as soon as I have finished taking care of other things on my plate. Might take me another week to get to this. |
This PR adds support for store switchovers to useHookstate() for global and nested state. Local state behavior remains unchanged. Additionally, setting state after unmount no longer throws an error, which is more in line w/ how React's built-in useState hook works.
TLDR; Eliminated HOOKSTATE-111 and HOOKSTATE-106 exceptions.
closes #364