Skip to content

Add handler "subscribeAction.error" #1558

@de-don

Description

@de-don

What problem does this feature solve?

The "subscribeAction.after" is not run if an action throws an error.

What does the proposed API look like?

I propose to add one more property for catching errors in actions:

const waitPlugin = (store) => {
  store.subscribeAction({
    before: (action) => {
      console.log(action.type);
    },
    after: (action) => {
      console.log(action.type);
    },
    error: (action, error) => {
      console.log(action.type);
    }
  });
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions