1

I'm just getting started with NgRx and I'm struggling with the live example in the Walkthrough of NgRx (https://ngrx.io/guide/store/walkthrough). It fails with the following error message:

Property 'store' is used before its initialization.

Does anyone know how to fix it? I have created a StackBlitz fork here:

https://stackblitz.com/edit/angular-wstvmm?file=src/app/app.component.ts

Frank Jusnes
  • 175
  • 1
  • 13

1 Answers1

1

try

  books$;
  bookCollection$;
  
  constructor(private booksService: GoogleBooksService, private store: Store) {
    this.books$ = this.store.select(selectBooks);
    this.bookCollection$ = this.store.select(selectBookCollection);
  }
Kohey
  • 26
  • 1