本文整理汇总了TypeScript中rxjs.of函数的典型用法代码示例。如果您正苦于以下问题:TypeScript of函数的具体用法?TypeScript of怎么用?TypeScript of使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了of函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should support a scheduler', () => {
const o = of('a', 'b', 'c').pipe(timeout(10, asyncScheduler)); // $ExpectType Observable<string>
const p = of('a', 'b', 'c').pipe(timeout(new Date(), asyncScheduler)); // $ExpectType Observable<string>
});
示例2: concatMap
concatMap(() => options.deleteOutputPath
? this._deleteOutputDir(root, normalize(options.outputPath), this.context.host)
: of(null)),
示例3: it
it('should enforce types', () => {
const o = of('a', 'b', 'c').pipe(repeat('aa')); // $ExpectError
});
示例4: it
it('should support an undefined predicate with a T default', () => {
const o = of('foo').pipe(last(undefined, 'bar')); // $ExpectType Observable<string>
});
示例6: getHeroes
// getHeroes(): Hero[]{
// return HEROES
// }
getHeroes(): Observable<Hero[]> {
// return of(HEROES);
this.messageService.add('HeroService: xxxx');
return of(HEROES)
}
示例7: observableOf
getSystem(): Observable<DotWorkflow> {
const systemWorkflow = mockWorkflows.filter((workflow: DotWorkflow) => workflow.system);
return observableOf(_.cloneDeep(systemWorkflow[0]));
}
示例8: observableOf
factory: () => (fem: Tree) => {
inner = fem;
return observableOf(empty());
},
示例9: observableOf
enumerate() {
return observableOf(queryResult);
}