Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
todo-list.effects.ts
@Injectable()
export class TodoListEffects {
public getTodoListRequest$ = createEffect(() =>
this.actions$.pipe(
ofType(TodoListActions.getTodoListRequest),
exhaustMap(() =>
this.todoListResourcesService.getTodos().pipe(
map(todoList => TodoListActions.getTodoListResponse({ todoList })),
catchError((error: Error) =>
of(TodoListActions.getTodoListFailed({ error })),
),
),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.