Files
dspace-angular/src/app/header/header.actions.ts
William Welling 066bba28af fixed lint errors
2017-07-13 11:19:02 -05:00

41 lines
1.1 KiB
TypeScript

import { Action } from '@ngrx/store';
import { type } from '../shared/ngrx/type';
/**
* For each action type in an action group, make a simple
* enum object for all of this group's action types.
*
* The 'type' utility function coerces strings into string
* literal types and runs a simple check to guarantee all
* action types in the application are unique.
*/
export const HeaderActionTypes = {
COLLAPSE: type('dspace/header/COLLAPSE'),
EXPAND: type('dspace/header/EXPAND'),
TOGGLE: type('dspace/header/TOGGLE')
};
/* tslint:disable:max-classes-per-file */
export class HeaderCollapseAction implements Action {
type = HeaderActionTypes.COLLAPSE;
}
export class HeaderExpandAction implements Action {
type = HeaderActionTypes.EXPAND;
}
export class HeaderToggleAction implements Action {
type = HeaderActionTypes.TOGGLE;
}
/* tslint:enable:max-classes-per-file */
/**
* Export a type alias of all actions in this action group
* so that reducers can easily compose action types
*/
export type HeaderAction
= HeaderCollapseAction
| HeaderExpandAction
| HeaderToggleAction