當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript forkJoin.forkJoin函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。