Angular 类型的参数不可分配给类型为';运算符函数<;未知[]>';
我最近更新到Angular 9,并在我的user.effects.ts文件中不断收到此错误:Angular 类型的参数不可分配给类型为';运算符函数<;未知[]>';,angular,typescript,redux,rxjs,ngrx,Angular,Typescript,Redux,Rxjs,Ngrx,我最近更新到Angular 9,并在我的user.effects.ts文件中不断收到此错误: ERROR in src/app/modules/core/store/user/user.effects.ts:30:9 - error TS2345: Argument of type 'OperatorFunction<IUser, { payload: Partial<IUser>; } & TypedAction<"[Use r] Data Received"&
ERROR in src/app/modules/core/store/user/user.effects.ts:30:9 - error TS2345: Argument of type 'OperatorFunction<IUser, { payload: Partial<IUser>; } & TypedAction<"[Use
r] Data Received">>' is not assignable to parameter of type 'OperatorFunction<unknown[], { payload: Partial<IUser>; } & TypedAction<"[User] Data Received">>'.
Type 'IUser' is missing the following properties from type 'unknown[]': length, pop, push, concat, and 26 more.
30 map(
~~~~
31 (data: IUser) => UserActions.dataReceived({ payload: UserService.parseData(data) })
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 )
你的代码应该是
new UserActions.dataReceived({ payload: UserService.parseData(data) })
如果您还有任何问题,请告诉我
new UserActions.dataReceived({ payload: UserService.parseData(data) })