Skip to content

Instantly share code, notes, and snippets.

@yackinn
Last active January 20, 2021 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yackinn/8cd703cfb848e3f25a944d90c24c22c1 to your computer and use it in GitHub Desktop.
Save yackinn/8cd703cfb848e3f25a944d90c24c22c1 to your computer and use it in GitHub Desktop.
@Injectable()
export class TodoEffects {
constructor(
private actions$: Actions,
private todoService: TodoService,
) {
}
loadTodos$ = createEffect(() => this.actions$.pipe(
ofType(TodoActions.loadTodos),
switchMap(() => this.todoService.get())
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment