ReactJs How to update a model's “meta” state with latest redux-orm version (0.9.x)? reactjs update state,reactjs update array in state,reactjs update

I'm trying to implement redux-orm and not sure of the best way to handle updating meta properties on my models. The return value of static reducers are ignored in the latest version, and looking through the API I can't see any way to modify the meta property from a model inside of the static reducer function.

IE, for standard entity state updates, here is the example from the repo:

static reducer(action, Book, session) {
    switch (action.type) {
    case 'CREATE_BOOK':
        Book.create(action.payload);
        break;
    case 'UPDATE_BOOK':
        Book.withId(action.payload.id).update(action.payload);
        break;
    case 'REMOVE_BOOK':
        const book = Book.withId(action.payload);
        book.delete();
        break;
    ... this function calls the model directly and has no return value

I found a couple of examples of a static metaReducer implementation, but these are all with an older version. I could make a sibling reducer to handle this but I'd prefer for everything to be on my actual ORM entities, and to utilize the provided meta property.

If anyone has a simple example of implementing a meta reducer with the latest version of redux-orm it would be much appreciated.

Thanks!

Answer:1



  1. reactjs update state
  2. reactjs update array in state
  3. reactjs update props
  4. reactjs update component
  5. reactjs update url without reload
  6. reactjs update child state from parent
  7. reactjs update state when props change
  8. reactjs update object in array

I have the following component as part of my large component. <UI.Field horizontal value={ <FormattedNumber style="currency" currency="EUR" data-...

I have the following component as part of my large component. <UI.Field horizontal value={ <FormattedNumber style="currency" currency="EUR" data-...

I have a React component with the following proptypes defined: NavBar.propTypes = { navbar: PropTypes.arrayOf(PropTypes.shape({ brand: PropTypes.shape({ linkTo: PropTypes.string, ...

I have a React component with the following proptypes defined: NavBar.propTypes = { navbar: PropTypes.arrayOf(PropTypes.shape({ brand: PropTypes.shape({ linkTo: PropTypes.string, ...