问题描述
此效果正常运行,但 webstorm 似乎无法识别。
sendUserName$ = createEffect(() =>
this.actions$.pipe(
ofType(sendUserName),map((action) => {
return this.usernameService.SearchUserName(action.username).pipe(
map((result) => of(sendUserNameSuccess({found: result.found}))),catchError((error: HttpErrorResponse) => of(sendUserNameFail({error: error.message})))
);
})
));
错误信息是:
Argument type () => Observable<Observable<({error: string} & TypedAction<"[app] Send user name Failed">) | Observable<{found: boolean} & TypedAction<"[app] Send user name success">>>> is not assignable to parameter type () => (EffectResult<ObservableType<dispatchType<EffectConfig>,OT>> & ConditionallydisallowActionCreator<dispatchType<EffectConfig>,EffectResult<ObservableType<dispatchType<EffectConfig>,OT>>>)
有人知道这是什么意思以及如何解决吗?
解决方法
我遇到了同样的问题,删除 node_modules 并重新安装所有节点包为我解决了问题。