Skip to content

Store should fail synchronously when dispatching an action that triggers reducer to throw error #1865

@alex-okrushko

Description

@alex-okrushko

That was the behavior that we had in v7

this.stateSubscription = stateAndAction$.subscribe({
next: ({ state, action }) => {
this.next(state);
scannedActions.next(action);
},
error: err => this.error(err),

We should also add the test like this:

it('should throw the error synchronously', () => {
      expect(() => {store.dispatch(ActionThatWouldThrowAnErrorInReducer));})
        .toThrowError('error in reducer'));
    });

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions