1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

added useMemos to get data hooks

This commit is contained in:
Fedor Katurov 2022-01-09 19:28:23 +07:00
parent 1904153bba
commit d9feff085a
11 changed files with 49 additions and 19 deletions

View file

@ -2,7 +2,6 @@ import { useFlowLayout } from '~/hooks/flow/useFlowLayout';
import { useMemo } from 'react';
import { useFlowLoader } from '~/hooks/flow/useFlowLoader';
import { useFlowStore } from '~/store/flow/useFlowStore';
import { useInfiniteLoader } from '~/hooks/dom/useInfiniteLoader';
import { useFlowSetCellView } from '~/hooks/flow/useFlowSetCellView';
import { useGetLabStats } from '~/hooks/lab/useGetLabStats';
@ -13,10 +12,19 @@ export const useFlow = () => {
const { isFluid, toggleLayout } = useFlowLayout();
const lab = useGetLabStats();
useInfiniteLoader(loadMore, isSyncing);
const updates = useMemo(() => [...updated, ...lab.updates].slice(0, 10), [lab.updates, updated]);
const onChangeCellView = useFlowSetCellView();
return { nodes, heroes, recent, updates, isFluid, toggleLayout, onChangeCellView };
return {
nodes,
heroes,
recent,
updates,
isFluid,
toggleLayout,
onChangeCellView,
loadMore,
isSyncing,
};
};