本文整理匯總了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);
}