I created a subscription service to fetch a value, which was then used to call another API. However, the initial subscription API has now changed and the value can potentially be null. How should I handle this situation? My code is generating a compile error in oc.id
as it may possibly return 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 }));
})
)
)));