@roochnetwork/rooch-sdk-kit
Version:
Rooch SDK Kit
29 lines (25 loc) • 775 B
JavaScript
// 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);
}
// src/hooks/useCurrentSession.ts
function useCurrentSession() {
return useSessionStore((state) => state.currentSession);
}
export {
useCurrentSession
};
//# sourceMappingURL=useCurrentSession.js.map