super selectOne
This commit is contained in:
parent
2cc645b116
commit
f004270fbe
|
@ -13,7 +13,7 @@ import { RPCClientError } from '@loafer/ng-rpc';
|
|||
})
|
||||
export class ProbeDetailContainerComponent implements OnInit {
|
||||
|
||||
@Input() probeHostID;
|
||||
@Input() probeHostID: number;
|
||||
@Output() discovery = new EventEmitter<number>();
|
||||
probeHost$: Observable<ProbeHost>;
|
||||
error$: Observable<RPCClientError>;
|
||||
|
@ -22,10 +22,10 @@ export class ProbeDetailContainerComponent implements OnInit {
|
|||
private store: Store<ProbeStore.State>,
|
||||
private route: ActivatedRoute,
|
||||
) {
|
||||
this.probeHost$ = store.pipe(select(ProbeSelector.selectOne(this.probeHostID)));
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.probeHost$ = this.store.pipe(select(ProbeSelector.selectOne(this.probeHostID)));
|
||||
this.store.dispatch(new ProbeStore.Read(this.probeHostID));
|
||||
}
|
||||
|
||||
|
|
|
@ -8,23 +8,26 @@ import { StateSelector } from '@overflow/core/ngrx/store';
|
|||
|
||||
import { MODULE } from '../probe.constant';
|
||||
|
||||
import * as ProbeStore from './entity/probe';
|
||||
import * as ProbeEntityStore from './entity/probe';
|
||||
import * as ProbeListContainerStore from './container/probe-list';
|
||||
|
||||
export interface State {
|
||||
probes: ProbeStore.State;
|
||||
probes: ProbeEntityStore.State;
|
||||
probe_list_pending: ProbeListContainerStore.State;
|
||||
}
|
||||
|
||||
export const REDUCERS = {
|
||||
probes: ProbeStore.reducer,
|
||||
probes: ProbeEntityStore.reducer,
|
||||
probe_list_pending: ProbeListContainerStore.reducer,
|
||||
};
|
||||
|
||||
export const EFFECTS = [
|
||||
ProbeStore.Effects,
|
||||
ProbeEntityStore.Effects,
|
||||
];
|
||||
|
||||
export const selectState = createFeatureSelector<State>(MODULE.name);
|
||||
|
||||
export const ProbeSelector = ProbeStore.getSelectors(createSelector(
|
||||
export const ProbeSelector = ProbeEntityStore.getSelectors(createSelector(
|
||||
selectState,
|
||||
(state: State) => state.probes
|
||||
));
|
||||
|
|
Loading…
Reference in New Issue
Block a user