How can I achieve the following effect?
createAssignment$ = createEffect(() =>
this.action$.pipe(
ofType(AssignmentActions.createAssignment),
switchMap((action) =>
this.assignmentService.createNewAssignment(action.assignmentTo).pipe(
map((data) => AssignmentActions.createAssignmentSuccess({ createdAssignment: data }),
catchError((error) => of(error))),
)
)
));
I want to redirect the user to a new page based on the value from the 'data' object. Is it better to create a new effect for this or should I handle it directly under the action? Has anyone encountered a similar issue before?