I wrote subscribe service and get value form that and after that call another API. but the first subscription API changed. Now value can be null. so, how can I handle that?. Now code came compile error in, oc.id
, or can be null.
getE$ = createEffect(() => this.actions$.pipe(
ofType(ActionType.A),
switchMapTo(this.store.select(selectP)),
mergeMap((oc) => this.reviewService.findByR(oc.id,
new Date(new Date()),
new Date(new Date()), 'A')
.pipe(
mergeMap(d => {
return of(LoadSuccess({ reviews: getReviews(d) }));
}
),
catchError(error => {
return of(LoadFailure({ error: error }));
})
)
)));