我的ngrx store有问题,奇怪的问题!select算子不调用回调函数,订阅store的时候可以看到app的状态(初始状态和修改状态)
export class PatternsViewComponent implements OnInit {
patternsCategoryList$:Observable<string[]>;
// selectedPatternCategory$:Observable<string>;
constructor(private store: Store<ApplicationState>) {
this.store.select(mapToDataToSources);
}
ngOnInit() {
}
}
export function mapToDataToSources(state:ApplicationState) :String[]{
debugger;
console.log(state.uiStoreData.patterns);
return state.uiStoreData.patterns;
}