ahoym / redesert

Work in Progress - Opinionated HOFs for auto-generating REST API consuming redux logic
MIT License
3 stars 1 forks source link

Make create reducer #5

Closed ahoym closed 6 years ago

ahoym commented 6 years ago

Context

Adds the makeCreateReducer factory for usage in the defaultReducerFactories. Specifically handles only single entity additions (no batch creates, should make a separate reducer for these cases for clarity), sets errors to the errors property on the state slice root, and does not include a pending state by default.

This is because we recommend visualizing the redux store as a front end version of your database, as much as possible. Maintaining CREATE data structures that haven't been persisted to the data base yet violates that philosophy, and there are various strategies to handle that type of state. Some suggestions:

Additional Changes

Tasks