can expand on this code if needed, but...
private getApiResult<T>(
endpoint: string,
serviceId: ServiceId,
monitor?: ApiMonitorOptions
): Observable<T>{
return this.httpClient
.get<T>(endpoint)
.pipe(
withLatestFrom(this.store$.pipe(
select(fromServices.serviceStateSelector),
map(state => state.get(serviceId))
)),
retry({
count: monitor?.retryOptions?.count ?? 25,
// ** Here ** I need to pass the value of withLatestFrom to this handleError function
delay: (err, count) => this.handleError(err, count, serviceId, monitor)
}),
map(([result, state]) => this.handleSuccess(serviceId, result, state!, monitor))
);
}