Migrate Redux Toolkit slices to zustand
ProprietaryMoves a repository's one Redux Toolkit store to zustand when it is a configureStore of createSlice reducers with no other option, its sources are JavaScript, and every use of it converts: each slice becomes a zustand store whose action creators keep their names and run the slice's reducers through immer's produce, useSelector reads of one slice become the slice's zustand hook, dispatch and store.dispatch of the slices' action creators become calls of them, store.getState() reads become the slice store's getState(), and the react-redux Provider and the store's source are removed. Adds zustand and immer where they are missing. Stores with any other use, such as connect, thunks, selectors that build values or several stores, stay in Redux and are recorded for review.
org. openrewrite. react. migrate. redux-to-zustandmod run . --recipe= org. openrewrite. react. migrate. redux-to-zustandInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.