Skip to content

Create a version of handleActions which supports async actions too #2

@johanneslumpe

Description

@johanneslumpe

We want to be able to support handlers in the form of:

{
    begin: (state, action) => {},
    end: {
      next: (state, action) => {},
      throw: (state, action) => {},
    }
  }

In order to do so, we have to inspect themeta field of the action and switch on the async field there. We also have to make sure that the handlers receive all arguments the original action receives, so that we can do optimistic updates easily.

In case an async handler receives a non-async action it should just handle it the same way it would handle the end status of an async action.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions