redux-crud-mb
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Redux CRUD

FORKED FROM https://github.com/Versent/redux-crud/

Redux CRUD is a convention driven way of building CRUD applications using Redux. After building several Flux applications we found that we always end up creating the same action types, actions and reducers for all our resources.

Redux CRUD gives you a standard set of:

  • action types: e.g. USER_UPDATE_SUCCESS
  • actions: e.g. updateSuccess, updateError
  • reducers: for the action types above e.g. updateSuccess

Working with resources in Redux

When building an app you might have resources like users, posts and comments.

You'll probably end up with action types for them like:

  • USERS_FETCH_SUCCESS
  • POSTS_FETCH_SUCCESS
  • COMMENTS_FETCH_SUCCESS

And action creators like:

  • users.fetchSuccess
  • posts.fetchSuccess
  • comments.fetchSuccess

There's obvious repetition there. Redux CRUD aims to remove this boilerplate by providing strong conventions on naming and processing data.

Stores

Redux-crud provides two stores:

  • List. A plain JS array. This preserves the order of records.
  • Map. A JS object where records are indexed by key. This provides faster writes and lookups.

Docs

Actions

Reducers

Using with Redux

Tips

Testing

npm test

Example

You can see a basic example here

Readme

Keywords

Package Sidebar

Install

npm i redux-crud-mb

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

236 kB

Total Files

237

Last publish

Collaborators

  • niemisami
  • madbooster-kehitys
  • tol1