container store
This commit is contained in:
parent
f004270fbe
commit
67a924bcf1
|
@ -1,7 +1,15 @@
|
||||||
|
import { Selector, createSelector } from '@ngrx/store';
|
||||||
|
import { createEntityAdapter, EntityState } from '@loafer/ng-entity';
|
||||||
|
|
||||||
export interface State {
|
export interface State {
|
||||||
pending: boolean;
|
pending: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const initialState: State = {
|
export const initialState: State = {
|
||||||
pending: false,
|
pending: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export function getSelectors<S>(selector: Selector<any, State>) {
|
||||||
|
return {
|
||||||
|
selectPending: createSelector(selector, (state: State) => state.pending),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -13,12 +13,12 @@ import * as ProbeListContainerStore from './container/probe-list';
|
||||||
|
|
||||||
export interface State {
|
export interface State {
|
||||||
probes: ProbeEntityStore.State;
|
probes: ProbeEntityStore.State;
|
||||||
probe_list_pending: ProbeListContainerStore.State;
|
probe_list_container: ProbeListContainerStore.State;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const REDUCERS = {
|
export const REDUCERS = {
|
||||||
probes: ProbeEntityStore.reducer,
|
probes: ProbeEntityStore.reducer,
|
||||||
probe_list_pending: ProbeListContainerStore.reducer,
|
probe_list_container: ProbeListContainerStore.reducer,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const EFFECTS = [
|
export const EFFECTS = [
|
||||||
|
@ -32,4 +32,7 @@ export const ProbeSelector = ProbeEntityStore.getSelectors(createSelector(
|
||||||
(state: State) => state.probes
|
(state: State) => state.probes
|
||||||
));
|
));
|
||||||
|
|
||||||
|
export const ProbeListContainerSelector = ProbeListContainerStore.getSelectors(createSelector(
|
||||||
|
selectState,
|
||||||
|
(state: State) => state.probe_list_container
|
||||||
|
));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user