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

removed lab reducer

This commit is contained in:
Fedor Katurov 2022-01-05 15:57:29 +07:00
parent e24ea4afeb
commit 2b7b756212
26 changed files with 242 additions and 369 deletions

View file

@ -1,24 +1,24 @@
import { ILabNode } from '~/redux/lab/types';
import { ILabNode } from '~/types/lab';
import React, { createContext, FC, useContext } from 'react';
import { INode, ITag } from '~/redux/types';
import { IFlowNode, ITag } from '~/redux/types';
export interface LabContextProps {
isLoading: boolean;
nodes: ILabNode[];
count: number;
onLoadMore: () => void;
hasMore: boolean;
loadMore: () => void;
tags: ITag[];
heroes: Partial<INode>[];
heroes: IFlowNode[];
isLoadingStats: boolean;
updates: Partial<INode>[];
updates: IFlowNode[];
}
const defaultValues: LabContextProps = {
isLoading: false,
nodes: [],
count: 0,
onLoadMore: () => {},
hasMore: false,
loadMore: () => {},
tags: [],
heroes: [],
isLoadingStats: false,

View file

@ -5,14 +5,14 @@ import { useLab } from '~/hooks/lab/useLab';
interface LabProviderProps {}
const LabProvider: FC<LabProviderProps> = ({ children }) => {
const { isLoading, nodes, count, onLoadMore, tags, heroes, isLoadingStats, updates } = useLab();
const { isLoading, nodes, loadMore, hasMore, tags, heroes, isLoadingStats, updates } = useLab();
return (
<LabContextProvider
isLoading={isLoading && !nodes.length}
nodes={nodes}
count={count}
onLoadMore={onLoadMore}
hasMore={hasMore}
loadMore={loadMore}
tags={tags}
heroes={heroes}
isLoadingStats={isLoadingStats}