本文整理汇总了TypeScript中app/store.Store.select方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Store.select方法的具体用法?TypeScript Store.select怎么用?TypeScript Store.select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app/store.Store
的用法示例。
在下文中一共展示了Store.select方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
private queryStore<T>(selector: OutputSelector<Object, T, (res: Object) => T>) {
let obj: T;
this.store
.select(selector)
.pipe(first())
.subscribe(o => (obj = o));
return obj;
}
示例2: vectorLayer
private get vectorLayer() {
let vectorLayer: VectorLayer;
this.store
.select(getVectorLayer)
.pipe(first())
.subscribe(vl => (vectorLayer = vl));
return vectorLayer;
}
示例3: getThemeType
getThemeType() {
let result: { themeType: ThemeType; isInitialPageLoad: boolean };
this.store
.select(getThemeType)
.pipe(first())
.subscribe(res => (result = res));
return result;
}
示例4: getHiddenLayerIds
private getHiddenLayerIds() {
let hiddenLayerIds: ReadonlySet<string>;
this.store
.select(getHiddenLayerIds)
.pipe(first())
.subscribe(ids => (hiddenLayerIds = ids));
return hiddenLayerIds;
}
示例5: getAnimation
private getAnimation() {
let animation: Animation;
this.store
.select(getAnimation)
.pipe(first())
.subscribe(anim => (animation = anim));
return animation;
}
示例6: ngAfterViewInit
ngAfterViewInit() {
const activeViewport$ = this.store
.select(getVectorLayer)
.pipe(map(vl => ({ w: vl.width, h: vl.height })), distinctUntilChanged(_.isEqual));
this.registerSubscription(
combineLatest(this.canvasBounds$, activeViewport$).subscribe(([bounds, viewport]) => {
const w = Math.max(1, bounds.w - CANVAS_MARGIN * 2);
const h = Math.max(1, bounds.h - CANVAS_MARGIN * 2);
this.setDimensions({ w, h }, viewport);
}),
);
}
示例7: ngOnInit
ngOnInit() {
this.playbackModel$ = this.store.select(getPlaybackState);
}
示例8: asObservable
asObservable() {
return this.store.select(getThemeType);
}