本文整理汇总了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)));
示例2: createLabel
createLabel(label: LabelModel, url: string): Observable<LabelModel> {
return this.http.post<{data: LabelModel}>(url, {data: label})
.pipe(map(r => r.data));
}
示例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));
}
示例4: discover
discover(query: string) : Observable<Feed[]> {
return this.api.get<FeedsResponse>(`feed/discover?query=${query}`).pipe(
map(response => response.feeds)
);
}
示例5: deleteFeed
deleteFeed(id: number) : Observable<boolean> {
return this.api.delete<Status>(`feed/${id}`).pipe(
map(response => response.success)
);
}
示例6: concatMap
concatMap(tree => this._engine.transformOptions(this, options).pipe(
map(o => [tree, o]),
)),
示例7: switchMap
switchMap(run => run.output.pipe(map(output => ({ run, output })))),
示例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));
}
示例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));
}
示例10: map
({ project, repoName, prID }) =>
get<PRResponse>(buildURL(project, repoName, `/pull-requests/${prID}`)).pipe(
map(({ fromRef, toRef }) => ({ baseCommitID: toRef.latestCommit, headCommitID: fromRef.latestCommit }))
),