本文整理汇总了TypeScript中rxjs/observable/forkJoin.forkJoin函数的典型用法代码示例。如果您正苦于以下问题:TypeScript forkJoin函数的具体用法?TypeScript forkJoin怎么用?TypeScript forkJoin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了forkJoin函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: getData
getData() {
return forkJoin(
this.getLayers(),
this.getCategories(),
this.getSetting()
);
}
开发者ID:informationgrid,项目名称:ingrid-webmap-client,代码行数:7,代码来源:http.service.ts
示例2: forkJoin
return editChannel.switchMap(() => {
const thingsToAdd = this.getThingsToAdd(channelFormData, channel);
if (thingsToAdd.length) {
return forkJoin(this.createThingsConnectRequests(channel.id, thingsToAdd));
} else {
return Observable.of([]);
}
}).switchMap(() => {
开发者ID:yanghua,项目名称:mainflux,代码行数:8,代码来源:channels.service.ts
示例3: forkJoin
this.httpManagerService.post('/json/user/lang', {'uid': this.getUid(), 'lang': key}).subscribe(res => {
forkJoin(
this.translateService.get(res.alert.content),
this.translateService.get('FORM_BUTTON_CLOSE'))
.subscribe(([msg, action]) => {
let snackBarRef = this.snackBar.open(msg, action, {
'duration': 5000
});
});
});
开发者ID:openevocracy,项目名称:openevocracy,代码行数:10,代码来源:language.service.ts
示例4: resolve
resolve(): Observable<Product[]> {
// Get IDs of all products in the shopping cart
const productsInCart = Object.keys(this.shoppingCartService.getItems());
// Create an array of lazy HTTP requests returned by getProductById(). Each request will fetch one product.
const requests = productsInCart.map(productId =>
this.productService.getProductById(productId));
return requests.length ?
forkJoin(requests) : // Spawn parallel requests and emit last value from each
of([]); // Return an empty observable
}
开发者ID:JCarran0,项目名称:ng-shop,代码行数:12,代码来源:cart-resolver.ts
示例5: it
it('it should upload, download, and delete', (done) => {
const data = { angular: "fire" };
const blob = new Blob([JSON.stringify(data)], { type : 'application/json' });
const ref = afStorage.ref('af.json');
const task = ref.put(blob);
// Wait for the upload
const sub = forkJoin(task.snapshotChanges())
// get the url download
.mergeMap(() => ref.getDownloadURL())
// assert the URL
.do(url => expect(url).toBeDefined())
// Delete the file
.mergeMap(url => ref.delete())
// finish the test
.subscribe(done, done.fail);
});
开发者ID:acipher,项目名称:angularfire2,代码行数:16,代码来源:storage.spec.ts
示例6: function
return function(control: AbstractControl) {
const observables = _executeAsyncValidators(control, presentValidators).map(toObservable);
return map.call(forkJoin(observables), _mergeErrors);
};
开发者ID:AnthonyPAlicea,项目名称:angular,代码行数:4,代码来源:validators.ts
示例7: updateCategoryTreeAndCategories
updateCategoryTreeAndCategories(id: string, item: any) {
return forkJoin(
this.updateCategoryTree(id, item),
this.getCategories()
);
}
开发者ID:informationgrid,项目名称:ingrid-webmap-client,代码行数:6,代码来源:http.service.ts
注:本文中的rxjs/observable/forkJoin.forkJoin函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论