Skip to content
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

Reset atoms no longer remove from local storage #50

Open
caviyacht opened this issue Oct 25, 2021 · 3 comments
Open

Reset atoms no longer remove from local storage #50

caviyacht opened this issue Oct 25, 2021 · 3 comments

Comments

@caviyacht
Copy link

It appears that Recoil 0.4.0 introduced a breaking change around how the DefaultValue and effects work. The onSet method no longer gets the DefaultValue when reset, but instead an actual value. The logic to remove the key from local storage was dependent on this.

https://recoiljs.org/blog/2021/07/30/0.4.0-release#fixes-and-optimizations

@caviyacht
Copy link
Author

Update to this. I mentioned on the Recoil repo that it appears to function correctly if you use a selector as the default value to an atom. I've switched to using this for now, but it seems like that might not stay as well.

@caviyacht
Copy link
Author

@polemius , Recoil 0.5 was released with an enhancement to this area. isReset can now be used to know if an atom was reset in an effect.

ref: facebookexperimental/Recoil#1358

@polemius
Copy link
Owner

polemius commented Nov 7, 2021

Thank you! New resetting atom logic was just released in 4.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants