I implemented method using combinlatest
rsjx/operator one, it work properly but sonar issue given said it deprecated.so , I need to convert it latest one. but I try, just replace import it gave error. I need some expert help to do this .
gX$ = createEffect(() => this.actions$.pipe(
ofType(ActionType.A),
combineLatest(this.service.getoc()),
mergeMap(([, oc]) => this.reviewService.findBy(oc.id,
new Date(),
new Date(new Date().setDate(new Date().getDate() + 1)))
.pipe(
mergeMap(d => {
return of(reviewLoadSuccess({ reviews: getReviews(d) }));
}
),
catchError(error => {
return of(reviewLoadFailure({ error: error }));
})
)
)));
Since it seems that you only need the value returned by
this.service.getoc()
, I would recommend of usingswitchMapTo
operator instead, as demonstrated belowConsider applying the following changes, should you want to use the action as well :