saasquatch / bunshi

Molecule pattern for jotai, valtio, zustand, nanostores, xstate, react and vue
https://www.bunshi.org/
MIT License
230 stars 17 forks source link

Question: live of state in atoms #15

Closed carlesba closed 1 year ago

carlesba commented 1 year ago

I noticed atoms are kept in memory after scope is changed so they won't be created again when the scope is set back to an previous state. Is there a way to manage that? Can we clear those atoms in any way? I remember that Jotai family provides so functions to evaluate the state of an atom when it's accessed so we can handle it validity.

Thanks for this awesome library.

loganvolkers commented 1 year ago

Thanks for the question @carlesba and sorry it's taken so long for you to get a response.

Can you help provide more details on what you were trying to achieve?

If you can provide a code example that will help me and others that might be facing a similar issue.