subtracks/app/hooks/useClient.ts
2022-04-28 15:41:45 +09:00

16 lines
250 B
TypeScript

import { useStore } from '@app/state/store'
const useClient = () => {
const client = useStore(store => store.client)
return () => {
if (!client) {
throw new Error('no client!')
}
return client
}
}
export default useClient