本文整理匯總了TypeScript中rxjs/operator/mergeAll.mergeAll類的典型用法代碼示例。如果您正苦於以下問題:TypeScript mergeAll類的具體用法?TypeScript mergeAll怎麽用?TypeScript mergeAll使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了mergeAll類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: processRoutes
private processRoutes(ngModule: NgModuleRef<any>, routes: Routes): Observable<void> {
const res: Observable<any>[] = [];
for (const route of routes) {
// we already have the config loaded, just recurse
if (route.loadChildren && !route.canLoad && route._loadedConfig) {
const childConfig = route._loadedConfig;
res.push(this.processRoutes(childConfig.module, childConfig.routes));
// no config loaded, fetch the config
} else if (route.loadChildren && !route.canLoad) {
res.push(this.preloadConfig(ngModule, route));
// recurse into children
} else if (route.children) {
res.push(this.processRoutes(ngModule, route.children));
}
}
return mergeAll.call(from(res));
}
示例2: andObservables
export function andObservables(observables: Observable<Observable<any>>): Observable<boolean> {
const merged$ = mergeAll.call(observables);
return every.call(merged$, (result: any) => result === true);
}