28 lines
821 B
TypeScript
28 lines
821 B
TypeScript
import { createFeatureSelector, createSelector } from '@ngrx/store';
|
|
|
|
import * as CommonState from './common/state';
|
|
import * as CompanyState from './company/state';
|
|
import * as DepartmentState from './department/state';
|
|
|
|
export const KEY_FEATURE = 'organization';
|
|
|
|
export interface State {
|
|
common: CommonState.State;
|
|
company: CompanyState.State;
|
|
department: DepartmentState.State;
|
|
}
|
|
|
|
export const Selector = createFeatureSelector<State>(KEY_FEATURE);
|
|
|
|
export const CommonSelector = CommonState.selectors(
|
|
createSelector(Selector, (state: State) => state.common)
|
|
);
|
|
|
|
export const CompanySelector = CompanyState.selectors(
|
|
createSelector(Selector, (state: State) => state.company)
|
|
);
|
|
|
|
export const DepartmentSelector = DepartmentState.selectors(
|
|
createSelector(Selector, (state: State) => state.department)
|
|
);
|