You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
483 B

import { create } from "zustand";
import { immer } from "zustand/middleware/immer";
const store = (set) => ({
updateCounter: -1,
updatePVZLayer: -1,
toggleUpdateCounter: () => {
set((state) => {
state.updateCounter = state.updateCounter === -1 ? 1 : -1;
});
},
toggleUpdatePVZLayer: () => {
set((state) => {
state.updatePVZLayer = state.updatePVZLayer === -1 ? 1 : -1;
});
},
});
export const useUpdateLayerCounter = create(immer(store));