This repository has been archived by the owner on Jan 1, 2025. It is now read-only.
How can I implement a non React reaction (side effect) after an atom or selector change? #1202
Unanswered
zisiszikos
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You can use Atom Effects for this. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Assuming I have an Atom represanting a list like:
and there are a few places in my code that this array changes (add or remove item).
How can I write some code like a Reaction (side effect) that runs every time this atom's array change? And I mean without using React at all (useEffect, useCallback, useRecoilCallback).
For example, MobX has
reaction
s, redux has something likethunk
s orsaga
s.Beta Was this translation helpful? Give feedback.
All reactions