mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
docs: ngrx notification comments
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { createActionGroup, emptyProps } from '@ngrx/store';
|
import { createActionGroup, emptyProps } from '@ngrx/store';
|
||||||
|
|
||||||
|
// This is the global actions.
|
||||||
export const appActions = createActionGroup({
|
export const appActions = createActionGroup({
|
||||||
source: 'App Component',
|
source: 'App Component',
|
||||||
events: {
|
events: {
|
||||||
|
|||||||
@@ -31,9 +31,8 @@ export class NotificationService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (isSchool(notification)) {
|
if (isSchool(notification)) {
|
||||||
// SchoolStore is not providedin root. thus at initialization, SchoolStore is undefined
|
// SchoolStore is a ComponentStore. We can't dispatch a school action here.
|
||||||
// Option 1: set SchoolStore in root, but we don't want this to separate our class.
|
// We are stuck. We must have done something wrong and need to refactor...
|
||||||
// Option 2: your turn
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export class SchoolStore
|
|||||||
this.httpService.getAllSchools().pipe(
|
this.httpService.getAllSchools().pipe(
|
||||||
tapResponse(
|
tapResponse(
|
||||||
(schools) => this.patchState({ schools }),
|
(schools) => this.patchState({ schools }),
|
||||||
(_) => _,
|
(_) => _, // not handling the error
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user