frontPanel/src/stores/cash.ts

14 lines
330 B
TypeScript
Raw Normal View History

2024-04-06 09:07:30 +00:00
import { create } from "zustand";
import { devtools } from "zustand/middleware";
type Wallet = { cash: number }
export const useWallet = create<Wallet>()(
devtools(() => (
{ cash: 0 }
))
);
export const setCash = (cash: number) => {
console.log("я получил ", cash)
useWallet.setState({ cash })
};