Versent / redux-crud

A set of standard actions and reducers for Redux CRUD Applications
MIT License
623 stars 54 forks source link

Add the option to pass `partial` in `data` to `updateSuccess` #74

Open d3dc opened 6 years ago

d3dc commented 6 years ago

This will cause the store merge to patch an existing record using ramda's mergeDeepRight

This addresses #34.

Add tests to 'success.test.ts' and 'reducersFor.test.ts' for both list and map

(I think I may have been the first to autoformat according to the .editorconfig too...)

sporto commented 6 years ago

hi @d3dc thanks for working on this. Following the discussion in https://github.com/Versent/redux-crud/issues/34 it seems that people have different ideas on how this should behave. Would you be willing to modify your PR so the config takes functions for the update. e.g. something like a function that takes the prev item, the new item and returns the merged item. In that way we can support anything that people have in mind. The default function would be the current way of doing things.

Also, please keep the previous whitespace formatting, changing the indentation makes it harder to review.