我有史诗般的弹跳功能,直到成功调用ping api为止。我测试成功ping情况。我想使用import { TestScheduler } from 'rxjs/testing';
进行测试,以便在无法ping通第1个呼叫时进行测试,但使用大理石图在第2个呼叫中成功。有例子吗?
export const resendData = (action$, store$, {service}) => {
return action$
.pipe(
ofType(
SOMETHING_FALL
),
debounce(() => service.get('/api/ping').pipe(
retryWhen(err =>
err.pipe(
scan((acc, _) => acc * 2, 2),
delayWhen(val => timer(val * 1000))
)
),
catchError(_ => empty())),
),
map(_ => retryAction()),
);
}