Open
Description
Most of the Redux code is this package was written years ago and has not been touched since. In that time, Redux has come a long way! The bad news is that this codebase goes against a lot of the Redux Best Practices. The good news is that the newer ways of doing things are much easier and involve a lot less boilerplate.
Some things which can be improved/changed:
- Can use
createSlice
which automatically creates the action creators for a reducer so that you don't need to define a bajillion constants or define basic action creator functions. This can be tackled one "slice" at a time, as Redux Toolkit is fully compatible with old/vanilla Redux. - Can use
createAsyncThunk
to automatically dispatchpending
,error
andfulfilled
actions for each asynchronous action. - Can use
useSelector
anduseDispatch
hooks instead of theconnect
HOC.
I can do a lot of this myself, but I wanted to post it as a discussion first because I don't want to waste time rewriting code if it's not wanted.