[AAE-7145] upgrade to Ngrx 10 (#2479)

* upgrade to ngrx 10

* fix auth proxy

* migrate effects to newer syntax
This commit is contained in:
Denys Vuika
2022-03-24 11:36:21 +00:00
committed by GitHub
parent 305ec58e2b
commit 1727554517
21 changed files with 975 additions and 759 deletions

View File

@@ -74,14 +74,17 @@ export class ShowMydDialogAction implements Action {
`src/app/store/effects/app.effects.ts` を更新します:
```ts
import { createEffect } from '@ngrx/effects';
import { ShowMydDialogAction, SHOW_MY_DIALOG } from '../actions/app.actions';
@Injectable()
export class AppEffects {
@Effect({ dispatch: false })
showMyDialog$ = this.actions$.pipe(
ofType<ShowMydDialogAction>(SHOW_MY_DIALOG),
map(() => {})
showMyDialog$ = createEffect(
() => this.actions$.pipe(
ofType<ShowMydDialogAction>(SHOW_MY_DIALOG),
map(() => {})
),
{ dispatch: false }
);
}
```
@@ -93,6 +96,7 @@ export class AppEffects {
ダイアログを表示するための更新
```ts
import { createEffect } from '@ngrx/effects';
import { MatDialog } from '@angular/material/dialog';
import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my-extension-dialog.component';
@@ -100,12 +104,14 @@ import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my
export class AppEffects {
constructor(private dialog: MatDialog) {}
@Effect({ dispatch: false })
showMyDialog$ = this.actions$.pipe(
ofType<ShowMydDialogAction>(SHOW_MY_DIALOG),
map(() => {
this.dialog.open(MyExtensionDialogComponent)
})
showMyDialog$ = createEffect(
() => this.actions$.pipe(
ofType<ShowMydDialogAction>(SHOW_MY_DIALOG),
map(() => {
this.dialog.open(MyExtensionDialogComponent)
})
),
{ dispatch: false }
);
}
```