mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
23 lines
570 B
TypeScript
23 lines
570 B
TypeScript
import { createContext, useContext } from 'react';
|
|
|
|
import { ItemListKey } from '/@/shared/types/types';
|
|
|
|
interface ListContextProps {
|
|
customFilters?: Record<string, unknown>;
|
|
id?: string;
|
|
itemCount?: number;
|
|
listData?: unknown[];
|
|
pageKey: ItemListKey | string;
|
|
setItemCount?: (itemCount: number) => void;
|
|
setListData?: (items: unknown[]) => void;
|
|
}
|
|
|
|
export const ListContext = createContext<ListContextProps>({
|
|
pageKey: '',
|
|
});
|
|
|
|
export const useListContext = () => {
|
|
const ctxValue = useContext(ListContext);
|
|
return ctxValue;
|
|
};
|