mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
29 lines
704 B
TypeScript
29 lines
704 B
TypeScript
import { map } from 'rxjs/operators';
|
|
import { Injectable } from '@angular/core';
|
|
import { Effect, Actions, ofType } from '@ngrx/effects'
|
|
import * as fromRouter from '@ngrx/router-store';
|
|
|
|
import { HostWindowActionTypes } from '../shared/host-window.actions';
|
|
import { HeaderCollapseAction } from './header.actions';
|
|
|
|
@Injectable()
|
|
export class HeaderEffects {
|
|
|
|
@Effect() resize$ = this.actions$
|
|
.pipe(
|
|
ofType(HostWindowActionTypes.RESIZE),
|
|
map(() => new HeaderCollapseAction())
|
|
);
|
|
|
|
@Effect() routeChange$ = this.actions$
|
|
.pipe(
|
|
ofType(fromRouter.ROUTER_NAVIGATION),
|
|
map(() => new HeaderCollapseAction())
|
|
);
|
|
|
|
constructor(private actions$: Actions) {
|
|
|
|
}
|
|
|
|
}
|