@lifi/widget
Version:
LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.
26 lines (21 loc) • 629 B
text/typescript
import { create } from 'zustand'
import { useShallow } from 'zustand/shallow'
import type { SendToWalletStore } from './types.js'
export const sendToWalletStore = create<SendToWalletStore>((set) => ({
showSendToWallet: false,
setSendToWallet: (value) =>
set({
showSendToWallet: value,
}),
}))
export const useSendToWalletStore = <T>(
selector: (state: SendToWalletStore) => T
): T => {
return sendToWalletStore(useShallow(selector))
}
export const useSendToWalletActions = () => {
const actions = useSendToWalletStore((store) => ({
setSendToWallet: store.setSendToWallet,
}))
return actions
}