1
0
Files
yel-dspace-angular/src/app/community-list-page/community-list.actions.ts
Marie Verdonck 9bd1933548 66391: expandedNodes (&loadingNode) is now retrieved/sent to the store
at component initialisation/destruction so the state of the tree persists
& documentation
2019-11-26 17:23:49 +01:00

36 lines
803 B
TypeScript

import { Action } from '@ngrx/store';
import { type } from '../shared/ngrx/type';
import { FlatNode } from './community-list-service';
/**
* All the action types of the community-list
*/
export const CommunityListActionTypes = {
SAVE: type('dspace/community-list-page/SAVE')
};
/**
* Community list SAVE action
*/
export class CommunityListSaveAction implements Action {
type = CommunityListActionTypes.SAVE;
payload: {
expandedNodes: FlatNode[];
loadingNode: FlatNode;
};
constructor(expandedNodes: FlatNode[], loadingNode: FlatNode) {
this.payload = { expandedNodes, loadingNode }
}
};
/**
* Export a type alias of all actions in this action group
* so that reducers can easily compose action types
*/
export type CommunityListActions = CommunityListSaveAction;