Running Logic Before Setting an Atom Value in Effect Typescript
Whats the correct way to run an effect as the
Basically I want to run logic before setting the value: check that a tip % is non-negative for instance.
I know I can write this logic in a wrapper function: but it seems like the correct way to do this would be to construct the atom from an effect or atom.fn
set() function returned from useAtom? Basically I want to run logic before setting the value: check that a tip % is non-negative for instance.
I know I can write this logic in a wrapper function: but it seems like the correct way to do this would be to construct the atom from an effect or atom.fn
