Replies: 2 comments 1 reply
-
Use import { onStop } from 'nanostores'
onStop($profile, () => {
// No subscribers
}) See also: https://github.com/nanostores/nanostores?tab=readme-ov-file#store-events |
Beta Was this translation helpful? Give feedback.
1 reply
-
Maybe we can mention |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to reset atoms right after the components that using the atoms are unmounted.
However, according to the documentation, it looks like there is no way to run disabled mode immediately.
So due to the delay, when a user re-enters the page within a second, the UI states stay the same.
Of course I can simply achieve it with
useEffect
's cleanup function, but I don't want to mess with the ideaDesigned to move logic from components to stores.
.If you guys have any better ideas or there are any options that I'm missing, please let me know.
Beta Was this translation helpful? Give feedback.
All reactions