From b5eefff9cfaf062bb45ae68528903cb69dd1a224 Mon Sep 17 00:00:00 2001 From: jdegand <70610011+jdegand@users.noreply.github.com> Date: Fri, 12 Jan 2024 12:53:02 -0500 Subject: [PATCH] docs: ngrx notification comments --- apps/ngrx/notification/src/app/app.actions.ts | 1 + .../notification/src/app/data-access/notification.service.ts | 5 ++--- apps/ngrx/notification/src/app/school/school.store.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/ngrx/notification/src/app/app.actions.ts b/apps/ngrx/notification/src/app/app.actions.ts index 8292b19..3dcba81 100644 --- a/apps/ngrx/notification/src/app/app.actions.ts +++ b/apps/ngrx/notification/src/app/app.actions.ts @@ -1,5 +1,6 @@ import { createActionGroup, emptyProps } from '@ngrx/store'; +// This is the global actions. export const appActions = createActionGroup({ source: 'App Component', events: { diff --git a/apps/ngrx/notification/src/app/data-access/notification.service.ts b/apps/ngrx/notification/src/app/data-access/notification.service.ts index aa295bf..b116140 100644 --- a/apps/ngrx/notification/src/app/data-access/notification.service.ts +++ b/apps/ngrx/notification/src/app/data-access/notification.service.ts @@ -31,9 +31,8 @@ export class NotificationService { ); } if (isSchool(notification)) { - // SchoolStore is not providedin root. thus at initialization, SchoolStore is undefined - // Option 1: set SchoolStore in root, but we don't want this to separate our class. - // Option 2: your turn + // SchoolStore is a ComponentStore. We can't dispatch a school action here. + // We are stuck. We must have done something wrong and need to refactor... } }); } diff --git a/apps/ngrx/notification/src/app/school/school.store.ts b/apps/ngrx/notification/src/app/school/school.store.ts index 0c18349..0fd31fa 100644 --- a/apps/ngrx/notification/src/app/school/school.store.ts +++ b/apps/ngrx/notification/src/app/school/school.store.ts @@ -35,7 +35,7 @@ export class SchoolStore this.httpService.getAllSchools().pipe( tapResponse( (schools) => this.patchState({ schools }), - (_) => _, + (_) => _, // not handling the error ), ), ),