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

completely removed flow-related sagas

This commit is contained in:
Fedor Katurov 2022-01-04 15:08:20 +07:00
parent 5f3accee48
commit 38eedab3c2
26 changed files with 326 additions and 310 deletions

View file

@ -1,20 +1,23 @@
import { useShallowSelect } from '~/hooks/data/useShallowSelect';
import { selectFlow } from '~/redux/flow/selectors';
import { useFlowLayout } from '~/hooks/flow/useFlowLayout';
import { selectLabUpdatesNodes } from '~/redux/lab/selectors';
import { useDispatch } from 'react-redux';
import { useFlowPagination } from '~/hooks/flow/useFlowPagination';
import { useCallback, useMemo } from 'react';
import { FlowDisplay, INode } from '~/redux/types';
import { flowSetCellView } from '~/redux/flow/actions';
import { useFlowLoader } from '~/hooks/flow/useFlowLoader';
import { useFlowStore } from '~/store/flow/useFlowStore';
import { useInfiniteLoader } from '~/hooks/dom/useInfiniteLoader';
export const useFlow = () => {
const { nodes, heroes, recent, updated, isLoading } = useShallowSelect(selectFlow);
const { loadMore, isSyncing } = useFlowLoader();
const { nodes, heroes, recent, updated } = useFlowStore();
const { isFluid, toggleLayout } = useFlowLayout();
const labUpdates = useShallowSelect(selectLabUpdatesNodes);
const dispatch = useDispatch();
useFlowPagination({ isLoading });
useInfiniteLoader(loadMore, isSyncing);
const updates = useMemo(() => [...updated, ...labUpdates].slice(0, 10), [updated, labUpdates]);