UNPKG

@mysten/dapp-kit

Version:

A collection of React hooks and components for interacting with the Sui blockchain and wallets.

23 lines (20 loc) 586 B
// src/hooks/wallet/useWalletStore.ts import { useContext } from "react"; import { useStore } from "zustand"; // src/contexts/walletContext.ts import { createContext } from "react"; var WalletContext = createContext(null); // src/hooks/wallet/useWalletStore.ts function useWalletStore(selector) { const store = useContext(WalletContext); if (!store) { throw new Error( "Could not find WalletContext. Ensure that you have set up the WalletProvider." ); } return useStore(store, selector); } export { useWalletStore }; //# sourceMappingURL=useWalletStore.js.map