I am using the below versions:
- @ngrx/[email protected]
- @ngrx/[email protected]
@ngrx/[email protected]
@angular/[email protected]
imports:
import { BookService } from './../services/book.service';
import {Actions, Effect, ofType} from '@ngrx/effects';
import {mergeMap, map} from 'rxjs/operators';
import {Action} from '@ngrx/store';
import * as types from './action.types';
import * as bookActions from './book.actions';
constructor:
constructor(private service: BookService,
private actions$: Actions){}
@Effect() loadBooks$: Observable<Action> = this.actions$.pipe(
ofType<bookActions.loadBooksAction>(types.LOAD_BOOKS),
mergeMap(() =>
this.service.getAllBooks().pipe(map(books =>
new bookActions.loadBooksSuccessAction(books)))
)
)
The Error: Property 'pipe' does not exist on type 'Actions'.