Can i use the async
with await
like this? Am i killing the async/await
here?
The code below is working without error, I know that the async/await
only works with Promise<T>
. My getItem
is an Observable
. Thanks.
roleService.getItem({ page: p.pageIndex + 1, pageSize: p.pageSize })
.takeUntil(this.unsubscribe$)
.map((res: ResponseDto) => <DtoModel>res.contentBody)
.do(async (dto: DtoModel) => await this.subject.next(dto.content)) // working wihtout error
.subscribe(async (dto: DtoModel) => await (this.pager = dto.pager), //working without error
(error: any) => Observable.throw(error));