Как повторно отправить запрос когда происходит dispatch

Есть action при dispatch подтягивает данные с бэка. Но в effect стоит таймер который отправляет запрос каждые 30 секунд,и вот мне нужно сделать так чтоб таймер сбросился при каждом dispatch и подтягивал все заново

main.page.ts

this.store.dispatch(loadBestExchangeRate({ id: item.instrId, operationType: 'ALL' }));

effect.ts

  loadBestExchangeRates$ = createEffect(() =>
    this.dataPersistence.fetch(ForexActions.loadBestExchangeRate, {
      run: (action: ReturnType<typeof ForexActions.loadBestExchangeRate>, state: ForexPartialState) => {
        return timer(0, 30000).pipe(
          distinctUntilChanged(),
          mergeMap(() => {
            return this.forexService.getBestExchangeRate(action.id, action.operationType).pipe(
              map((data: BestExchangeRate) => {
                return ForexActions.loadBestExchangeRateSuccess({ bestRates: data });
              }),
            );
          }),
        );
      },
      onError: (action: ReturnType<typeof ForexActions.loadBestExchangeRate>, error) => {
        return ForexActions.loadBestExchangeRateError({ error });
      },
    }),
  );

Ответы (0 шт):