本文整理汇总了TypeScript中rxjs/operators.pluck函数的典型用法代码示例。如果您正苦于以下问题:TypeScript pluck函数的具体用法?TypeScript pluck怎么用?TypeScript pluck使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pluck函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: Image
(() => {
const alertImg = new Image();
alertImg.src = ServerMapTheme.general.common.funcServerMapImagePath(ServerMapTheme.general.common.icon.error);
return zip(
serviceTypeImgLoadEvent$.pipe(pluck('target')),
fromEvent(alertImg, 'load').pipe(pluck('target'))
);
})(),
开发者ID:young891221,项目名称:pinpoint,代码行数:9,代码来源:server-map-diagram-with-visjs.class.ts
示例2: getUrlById
/**
* Get url by id
*
* @param string id
* @returns Observable<string>
* @memberof ContentletService
*/
getUrlById(id: string): Observable<string> {
return this.getContentTypes().pipe(
flatMap((structures: StructureTypeView[]) => structures),
pluck('types'),
flatMap((contentTypeViews: ContentTypeView[]) => contentTypeViews),
filter(
(contentTypeView: ContentTypeView) =>
contentTypeView.variable.toLocaleLowerCase() === id
),
pluck('action')
);
}
开发者ID:dotCMS,项目名称:core-web,代码行数:19,代码来源:dot-content-type.service.ts
示例3: ngOnInit
ngOnInit() {
this.route.data
.pipe(pluck('nextMatch', 'data'))
.subscribe((d: any) => {
this.router.navigate(this.matchRunnerRoute.matchRunnerRoute(d));
});
}
开发者ID:mightymoose,项目名称:mmoaig,代码行数:7,代码来源:redirect-to-match-runner.component.ts
示例4: pluck1
pluck1() {
const source = from([{ name: 'Joe', age: 30 }, { name: 'Sarah', age: 35 }]);
// grab names
const example = source.pipe(pluck('name'));
// output: "Joe", "Sarah"
const subscribe = example.subscribe(val => console.log(val));
}
开发者ID:zwvista,项目名称:SampleMisc,代码行数:7,代码来源:transforming.service.ts
示例5: function
Vue.prototype.$observe = function(fn, options = {}) {
const vm = this;
const obs$ = Observable.create(observer => {
let _unwatch;
const watch = () => {
_unwatch = vm.$watch(
fn,
(newValue, oldValue) => {
observer.next({ oldValue: oldValue, newValue: newValue });
},
{ immediate: true, ...options }
);
};
// if $watchAsObservable is called inside the subscriptions function,
// because data hasn't been observed yet, the watcher will not work.
// in that case, wait until created hook to watch.
if (vm._data) {
watch();
} else {
vm.$once("hook:created", watch);
}
// Returns function which disconnects the $watch expression
return () => _unwatch && _unwatch();
});
return obs$.pipe(pluck("newValue"));
};
开发者ID:kevmo314,项目名称:canigraduate.uchicago.edu,代码行数:28,代码来源:main.ts
示例6: unlock
/**
* Unlock a content asset
*
* @param string inode
* @returns Observable<any>
* @memberof PageViewService
*/
unlock(inode: string): Observable<any> {
return this.coreWebService
.requestView({
method: RequestMethod.Put,
url: `content/unlock/inode/${inode}`
})
.pipe(pluck('bodyJsonObject'));
}
开发者ID:dotCMS,项目名称:core-web,代码行数:15,代码来源:dot-contentlet-locker.service.ts
示例7: fireWorkflowAction
/**
* Updates the workflow actions for a page asset
*
* @param string inode
* @returns Observable<any> // contentlet
* @memberof DotWorkflowService
*/
fireWorkflowAction(inode: string, actionId: string): Observable<any> {
return this.coreWebService
.requestView({
method: RequestMethod.Put,
url: `v1/workflow/actions/${actionId}/fire?inode=${inode}`
})
.pipe(pluck('entity'));
}
开发者ID:dotCMS,项目名称:core-web,代码行数:15,代码来源:dot-workflow.service.ts
示例8: getContentWorkflowActions
/**
* Returns the wokflow or workflow actions for a page asset
*
* @param string inode
* @returns Observable<DotWorkflowAction[]>
* @memberof DotWorkflowService
*/
getContentWorkflowActions(inode: string): Observable<DotWorkflowAction[]> {
return this.coreWebService
.requestView({
method: RequestMethod.Get,
url: `v1/workflow/contentlet/${inode}/actions`
})
.pipe(pluck('entity'));
}
开发者ID:dotCMS,项目名称:core-web,代码行数:15,代码来源:dot-workflow.service.ts
示例9: loadFieldTypes
loadFieldTypes(): Observable<FieldType[]> {
return this.coreWebService
.requestView({
method: RequestMethod.Get,
url: 'v1/fieldTypes'
})
.pipe(pluck('entity'));
}
开发者ID:dotCMS,项目名称:core-web,代码行数:8,代码来源:field.service.ts
示例10: getLicense
private getLicense(): Observable<any> {
return this.coreWebService
.requestView({
method: RequestMethod.Get,
url: this.licenseURL
})
.pipe(pluck('entity', 'config', 'license'));
}
开发者ID:dotCMS,项目名称:core-web,代码行数:8,代码来源:dot-license.service.ts
注:本文中的rxjs/operators.pluck函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论