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


TypeScript operators.map函數代碼示例

本文整理匯總了TypeScript中rxjs/operators.map函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript map函數的具體用法?TypeScript map怎麽用?TypeScript map使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了map函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

 const computed = origin.filterx(number$ => number$.pipe(map(n => n % 2 === 0)));
開發者ID:milutinovici,項目名稱:proactive,代碼行數:1,代碼來源:computed-array-spec.ts

示例2: createLabel

 createLabel(label: LabelModel, url: string): Observable<LabelModel> {
   return this.http.post<{data: LabelModel}>(url, {data: label})
     .pipe(map(r => r.data));
 }
開發者ID:joshuawilson,項目名稱:almighty-ui,代碼行數:4,代碼來源:label.service.ts

示例3: addOrUpdate

 public addOrUpdate(faq: Faq): Observable<Faq> {
     let contentItem: ContentItem = faq.ToContentItem();
     return this.contentItemService.addOrUpdate(contentItem).pipe(
         map(contentItem => new Faq(contentItem)),
         catchError(this.handleError));
 }
開發者ID:jasebanico,項目名稱:banico,代碼行數:6,代碼來源:faq.service.ts

示例4: discover

 discover(query: string) : Observable<Feed[]> {
     return this.api.get<FeedsResponse>(`feed/discover?query=${query}`).pipe(
         map(response => response.feeds)
     );
 }
開發者ID:urandom,項目名稱:readeef,代碼行數:5,代碼來源:feed.ts

示例5: deleteFeed

 deleteFeed(id: number) : Observable<boolean> {
     return this.api.delete<Status>(`feed/${id}`).pipe(
         map(response => response.success)
     );
 }
開發者ID:urandom,項目名稱:readeef,代碼行數:5,代碼來源:feed.ts

示例6: concatMap

 concatMap(tree => this._engine.transformOptions(this, options).pipe(
   map(o => [tree, o]),
 )),
開發者ID:fmalcher,項目名稱:angular-cli,代碼行數:3,代碼來源:schematic.ts

示例7: switchMap

 switchMap(run => run.output.pipe(map(output => ({ run, output })))),
開發者ID:angular,項目名稱:angular-cli,代碼行數:1,代碼來源:rebuilds_spec_large.ts

示例8: getStorage

 getStorage(storageId: string): Observable<StorageEntity> {
     return this.http
         .get(`/api/configuration/strongbox/storages/${storageId}`)
         .pipe(map((r: any) => plainToClass(StorageEntity, r) as any));
 }
開發者ID:strongbox,項目名稱:strongbox-web-ui,代碼行數:5,代碼來源:storage-manager.service.ts

示例9: getRepository

 getRepository(storageId: string, repositoryId: string): Observable<Repository> {
     return this.http
         .get(`/api/configuration/strongbox/storages/${storageId}/${repositoryId}`)
         .pipe(map((r: any) => plainToClass(Repository, r) as any));
 }
開發者ID:strongbox,項目名稱:strongbox-web-ui,代碼行數:5,代碼來源:storage-manager.service.ts

示例10: map

 ({ project, repoName, prID }) =>
     get<PRResponse>(buildURL(project, repoName, `/pull-requests/${prID}`)).pipe(
         map(({ fromRef, toRef }) => ({ baseCommitID: toRef.latestCommit, headCommitID: fromRef.latestCommit }))
     ),
開發者ID:JoYiRis,項目名稱:sourcegraph,代碼行數:4,代碼來源:api.ts


注:本文中的rxjs/operators.map函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。