Skip to content

Run child reducer on redux-undo actions as well #129

@aeneasr

Description

@aeneasr

At the moment, redux-undo skips the child reducer when an action is triggered that is known to redux-undo, for example here:

      case config.undoType:
        res = undo(history)
        debug.log('perform undo')
        debug.end(res)
        return res

Unfortunately, I have a use case where I need to execute the reducer there as well. I am aware that this is a very specific use case which is why I think that this should be configurable:

      case config.undoType:
        res = undo(history)
        debug.log('perform undo')
        debug.end(res)
        return config.neverSkipReducer
          ? { ...res, present: reducer(res.present, action) }
          : res

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions