cachedResult: shouldUseCachedResult()

in src/pages/Home/index.tsx [84:121]


      cachedResult: shouldUseCachedResult(historyAction),
    });
    localStorage.setItem('home-params', JSON.stringify(rawParams));
  }, [historyAction, rawParams]);

  //
  // State
  //

  const [
    { showLoader, isLastPage, page, rungroups, newRuns, params, placeHolderParameters, initialised, isScrolledFromTop },
    dispatch,
  ] = useReducer(HomeReducer, {
    initialised: false,
    showLoader: true,
    isLastPage: false,
    page: historyAction === 'POP' ? HomeStateCache.page : 1,
    rungroups: historyAction === 'POP' ? HomeStateCache.data : {},
    newRuns: [],
    params: rawParams || defaultHomeParameters,
    placeHolderParameters: null,
    isScrolledFromTop: historyAction === 'POP' && HomeStateCache.scroll > 100,
  });

  const onUpdate = useCallback(
    (items: IRun[], result: DataModel<IRun[]> | undefined) => {
      // Remove old data if we are in first page/we handle fake params
      const replaceOld = page === 1 || !!placeHolderParameters;
      // Check if we just got last page so we can disable auto loader
      const lastPage = typeof result?.pages?.next !== 'number';
      dispatch({ type: 'data', data: items, replace: replaceOld, isLastPage: lastPage });
    },
    [page, placeHolderParameters],
  );

  const postRequest = useCallback(
    (success: boolean) => {
      if (!success && (page === 1 || placeHolderParameters)) {