UNPKG

@fakel/rest-admin

Version:

An application that makes it easier to work with your API

12 lines (9 loc) 398 B
import { useContext } from 'react'; import { AdminStore } from '../stores/AdminStore'; import { ClassPropsT, selectStore } from '../selectors/selectorStore'; import { AdminContext } from '../components/StoreProvider'; export const useStore = (name: ClassPropsT<AdminStore>) => { const { adminStore } = useContext(AdminContext); const store = selectStore(adminStore, name); return store; };