diff --git a/projects/ngrx.io/content/guide/store/actions.md b/projects/ngrx.io/content/guide/store/actions.md index 5db72c0f27..3ca8fc39d4 100644 --- a/projects/ngrx.io/content/guide/store/actions.md +++ b/projects/ngrx.io/content/guide/store/actions.md @@ -122,8 +122,9 @@ When passing a function to the `dispatch` method, it returns an `EffectRef`. For class BookComponent { bookId = input.required<number>(); loadBookEffectRef: EffectRef | undefined; + store = inject(Store); - ngOnInit(store: Store) { + ngOnInit() { // uses the injection context of Store, i.e. root injector this.loadBookEffectRef = store.dispatch(() => loadBook({ id: this.bookId() })); }