Jotai + RTK #1558
Jotai + RTK
#1558
Replies: 1 comment
-
Interesting. I didn't know you can use slice without store. It may work with one provider scenario (or no providers), but with multiple providers, I'm not sure which store/slice will be affected. This kind of enhancement will be more acceptable with new API (WIP) |
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
-
We were having a discussion internally about RTK for redux and benefits of it and it got me thinking if we could apply a similar style of definition to atoms.
Made this thought it was cool so I figured I would share.
https://codesandbox.io/s/jolly-fermi-tgmeh0?file=/src/App.tsx
Basically I wired
createSlice
up from RTK to an atom.I then just returned that Atom, the actions for that atom and limited the writable values of the atom to be the action types from create slice. Thought it was nifty / might support migrations for people w/ RTK applications that wanna move to Jotai.
Beta Was this translation helpful? Give feedback.
All reactions