2022-04-28 18:35:55 +03:00

12 lines
267 B
JavaScript

import { useContext } from 'react';
import { StoreContext } from '.';
export function useStore() {
const context = useContext(StoreContext);
if (context === undefined) {
throw new Error('useStore must be used within StoreProvider');
}
return context;
}