mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[AAE-7145] upgrade to Ngrx 10 (#2479)
* upgrade to ngrx 10 * fix auth proxy * migrate effects to newer syntax
This commit is contained in:
@@ -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 }
|
||||
);
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user