Rxjs `withLatestFrom`-使用observable实现时抛出错误
我正在尝试集成ngrx缓存,使用rxjs和LatestFrom操作符。但得到的错误如下所示:Rxjs `withLatestFrom`-使用observable实现时抛出错误,rxjs,ngrx,rxjs-pipeable-operators,Rxjs,Ngrx,Rxjs Pipeable Operators,我正在尝试集成ngrx缓存,使用rxjs和LatestFrom操作符。但得到的错误如下所示: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable. 有人请更正我的密码吗 这是我的密码: @影响 EffLoadCourse=this.actions.pipe ofTypeLoadCourse.TYPE, 最晚从 this.s
You provided 'undefined' where a stream was expected.
You can provide an Observable, Promise, Array, or Iterable.
有人请更正我的密码吗
这是我的密码:
@影响
EffLoadCourse=this.actions.pipe
ofTypeLoadCourse.TYPE,
最晚从
this.store.pipeselectsubscribes.getCourses,//从应用商店获取它
操作:LoadCourse,课程:ModelCourse[]=>{
//console.log'action is',action'courses is',courses
返回课程;
}
,
mergeMapcourses:ModelCourse[]=>{
如果课程{//如果课程可用,请将其返回
mapcourses:ModelCourse[]=>new LoadCourses成功课程,
新LoadCourseFailerr的catchErrorerr=>
回来
}
//仅在课程不可用时返回
返回此.courseService.getCourse.pipe
mapcourses:ModelCourse[]=>new LoadCourses成功课程,
新LoadCourseFailerr的catchErrorerr=>
}
您没有返回操作,只是一个空白请同时显示您的选择器getCourses,以及您如何在mergeMap中定义您的状态,您没有返回任何内容!课程
if(courses){ //if courses available just return it
map((courses:ModelCourse[]) => (new LoadCourseSuccess(courses))),
catchError(err => of(new LoadCourseFail(err)))
return;
}