UNPKG

@roochnetwork/rooch-sdk-kit

Version:
24 lines (21 loc) 645 B
// src/hooks/useSessionsStore.ts import { useContext } from "react"; import { useStore } from "zustand"; // src/provider/roochProvider.tsx import { createContext, useRef } from "react"; import { jsx, jsxs } from "react/jsx-runtime"; var RoochContext = createContext(null); // src/hooks/useSessionsStore.ts function useSessionStore(selector) { const store = useContext(RoochContext); if (!store) { throw new Error( "Could not find RoochSessionContext. Ensure that you have set up the RoochClientProvider." ); } return useStore(store, selector); } export { useSessionStore }; //# sourceMappingURL=useSessionsStore.js.map