toPromise is deprecated how to use the new version
1. Problem Restoration
The new version of rxjs in vscode will strikethrough toPromise(), indicating that it is deprecated.
The official answer
确实在5.5版本之后已经被弃用了
3. Problem solving
import {
lastValueFrom } from 'rxjs';
let res = await lastValueFrom(this.http.post(HTTP_BASE.host + AUTH_BASE, param));
这样就可以直接拿到接口返回的对象了
The above is the deprecated solution of toPromise, welcome to pay attention to the " Project Problems " column.
I will share the common problems in my usual projects and the knowledge of the written test and interview with you on CSDN, and make progress together. Come on.