diff --git a/projects/example-app/src/app/auth/effects/auth.effects.ts b/projects/example-app/src/app/auth/effects/auth.effects.ts index bdbb613e5c..7db06fe730 100644 --- a/projects/example-app/src/app/auth/effects/auth.effects.ts +++ b/projects/example-app/src/app/auth/effects/auth.effects.ts @@ -17,7 +17,7 @@ import { LogoutConfirmationDialogComponent } from '@example-app/auth/components/ export class AuthEffects { @Effect() login$ = this.actions$.pipe( - ofType(LoginPageActions.LoginPageActionTypes.Login), + ofType(LoginPageActions.LoginPageActionTypes.Login), map(action => action.payload.credentials), exhaustMap((auth: Credentials) => this.authService.login(auth).pipe( @@ -65,7 +65,7 @@ export class AuthEffects { ); constructor( - private actions$: Actions, + private actions$: Actions, private authService: AuthService, private router: Router, private dialog: MatDialog diff --git a/projects/example-app/src/app/books/effects/book.effects.ts b/projects/example-app/src/app/books/effects/book.effects.ts index 5c92e606cc..bee500a9af 100644 --- a/projects/example-app/src/app/books/effects/book.effects.ts +++ b/projects/example-app/src/app/books/effects/book.effects.ts @@ -12,7 +12,10 @@ import { } from 'rxjs/operators'; import { GoogleBooksService } from '@example-app/core/services/google-books.service'; -import { BooksApiActions, FindBookPageActions } from '@example-app/books/actions'; +import { + BooksApiActions, + FindBookPageActions, +} from '@example-app/books/actions'; import { Book } from '@example-app/books/models/book'; /** @@ -33,9 +36,7 @@ export class BookEffects { Action > => this.actions$.pipe( - ofType( - FindBookPageActions.FindBookPageActionTypes.SearchBooks - ), + ofType(FindBookPageActions.FindBookPageActionTypes.SearchBooks), debounceTime(debounce, scheduler), map(action => action.payload), switchMap(query => { @@ -57,7 +58,7 @@ export class BookEffects { ); constructor( - private actions$: Actions, + private actions$: Actions, private googleBooks: GoogleBooksService ) {} } diff --git a/projects/example-app/src/app/books/effects/collection.effects.ts b/projects/example-app/src/app/books/effects/collection.effects.ts index ffe5bd6c49..f38494e20c 100644 --- a/projects/example-app/src/app/books/effects/collection.effects.ts +++ b/projects/example-app/src/app/books/effects/collection.effects.ts @@ -47,9 +47,7 @@ export class CollectionEffects { @Effect() addBookToCollection$: Observable = this.actions$.pipe( - ofType( - SelectedBookPageActions.SelectedBookPageActionTypes.AddBook - ), + ofType(SelectedBookPageActions.SelectedBookPageActionTypes.AddBook), map(action => action.payload), mergeMap(book => this.db.insert('books', [book]).pipe( @@ -61,9 +59,7 @@ export class CollectionEffects { @Effect() removeBookFromCollection$: Observable = this.actions$.pipe( - ofType( - SelectedBookPageActions.SelectedBookPageActionTypes.RemoveBook - ), + ofType(SelectedBookPageActions.SelectedBookPageActionTypes.RemoveBook), map(action => action.payload), mergeMap(book => this.db.executeWrite('books', 'delete', [book.id]).pipe( @@ -73,5 +69,10 @@ export class CollectionEffects { ) ); - constructor(private actions$: Actions, private db: Database) {} + constructor( + private actions$: Actions< + SelectedBookPageActions.SelectedBookPageActionsUnion + >, + private db: Database + ) {} }