import React, { useContext } from 'react'; import { ListCollection, ListItem, ListState } from '../typings'; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion export const ListServiceContext = React.createContext(null!); const useListService = < T = any, I extends ListItem = ListItem, S extends ListState = ListState, >(): ListCollection => { return useContext(ListServiceContext) as ListCollection; }; export default useListService;