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:
@@ -63,14 +63,17 @@ See also:
|
||||
Update `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 }
|
||||
);
|
||||
}
|
||||
```
|
||||
@@ -82,6 +85,7 @@ See also:
|
||||
Update to raise a dialog
|
||||
|
||||
```ts
|
||||
import { createEffect } from '@ngrx/effects';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my-extension-dialog.component';
|
||||
|
||||
@@ -89,12 +93,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