frontPanel/src/stores/cash.ts

16 lines
416 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 = { cashString: string; cashCop: number; cashRub: number };
2024-04-06 09:07:30 +00:00
export const useWallet = create<Wallet>()(
devtools(() => ({ cashString: "", cashCop: 0, cashRub: 0 })),
2024-04-06 09:07:30 +00:00
);
export const setCash = (
cashString: string,
cashCop: number,
cashRub: number,
) => {
useWallet.setState({ cashString, cashCop, cashRub });
};