Note: crudux is still a work in progress.
Crudux is an attempt to dry up applications using Redux.
After creating a few Redux applications, we noticed we kept rewriting the
basic entity reducers/selectors. From those applications I've distilled some basic principals into crudux
.
- Keep request metadata state
- crudux stores metadata about requests so that your application can show appropriate loading indicators
- Paging
- crudux knows paging. We store pages and paging information from your requests to make it simple to page over your entities.
- Paging state is grouped into isolated
PageGroups
which allow multiple paging instances at once.
- Don't mess with your entities
- crudux stores operational metadata separately from your entities so you can expect to get out what you put in
Crudux comes with a reducer, and a set of actions / selectors to store your entity state.
It uses normalizr under the hood to store your entities in a normalized way.
npm install --save crudux
# or
yarn add crudux
TODO
- Fill this section out on how to create a reducer and attach it to your store.
- Finish testing for
reducers
andactions
. - Flush out tracking of optimistic changes for
creating
andupdating
This library was inspired by some great libraries out there.
- redux-crud for some initial ideas
- Redux Real World Example For the start of how to store entities