-
I know that actions have names, and was wondering if it's possible to subscribe to a particular action, such that you can cause a side effect when it's ran. This might sound counter-intuitive on the surface however, it's useful in areas like form validation. Typically with many form validation libs, such as Since the context of the
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
All logic should be in stores, and you should subscribe to some specific store changes. For form validation, I mostly used |
Beta Was this translation helpful? Give feedback.
action()
in Nano Stores is just a syntax sugar for logger.All logic should be in stores, and you should subscribe to some specific store changes.
For form validation, I mostly used
form
store. InuseEffect
I create a newform
store and propagate it down by context. This store has values and validation status.