馃槏馃槏馃槏
I am immensely impressed by the simplicity of this library and looking forward to using it in actual projects.
There are a few things that I'd love to have :
Yup! internally we have persistence and dev tool support. We're working on polishing the API so we can publish it and example libraries using it.
@shivamd20 Good feature request! While we are waiting for devtool support I've wrote the logger for recoil https://github.com/polemius/recoil-logger
For serialization and deserialization, use the useTransactionObservation and useSetUnvalidatedAtomValues hooks (unstable, API will likely change for the better in the next few weeks).
For the actual serialization/deserialization part, internally some of our apps use the Transit library
It's a flexible, hassle-free, and performant way to serialize. Maybe there's something newer that's emerged in the JS ecosystem since I last looked into this, I don't know. It works great for us. https://github.com/cognitect/transit-js
For side effects, I would suggest just having a component with useEffect. Let me know if there's something you'd like to do that isn't readily handled in that manner.
I suppose you could write hooks to wrap any mixing of Recoil state and side effects, but couldn't this also be done with selectors directly if the set function could be async so all the responsibility stays in Recoil and you can't mess it up by using the selector instead of the hook?
Just throwing this out more than anything else, I'd understand wanting to lean on React more.
I have to agree that if recoil could handle side-effects in a "graceful" standardized way (once i call a, then call b in case of success or c in case of failure), i would not just help avoid misunderstandings from developers, but also eliminates the need to have another library to deal with that!
It would be interesting to see examples of side-effects that can't cleanly be captured with the existing API and effects to evaluate requirements.
Hi everyone! I'm working on this right now!
Both packages can be found in this Github repository, in which i'm creating devtools for recoil based on existing redux devtools and other projects. In future, more devtools and docs will be available!
Most helpful comment
Yup! internally we have persistence and dev tool support. We're working on polishing the API so we can publish it and example libraries using it.