rtk-modules: helper utils for file splitting #2313
sam-mfb
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Redux Toolkit encourage breaking redux store's up into feature- specific "slices." In some code bases, it is desirable to further break up those slices into modules containing the feature-specific case reducers, selectors, and async thunks. This can reduce file size, make testing easier, and even allow for isolating individual redux slices in their own npm packages.
This library provides some helper functions to make this process easier while preserving the excellent type safety and type inferences provided by Redux Toolkit. It also provides some testing utilities to make testing these modularized files easier.
https://github.com/MFB-Technologies-Inc/rtk-modules
Basically it lets your put your case reducers and async thunk reducers in separate files will keeping all of RTK's nice typing inferences. It also lets you easily write slice-specific selectors and selector creators. And we provide a few testing utils that we've found useful for unit testing these elements (if you are in to that sort of thing).
These are utilities, and an approach, that we've found useful in our codebase, so we thought we'd open source it to get feedback and to help any one else trying to take a similar approach.
Beta Was this translation helpful? Give feedback.
All reactions