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
469 B
22 lines
469 B
import { create } from "zustand";
|
|
import { immer } from "zustand/middleware/immer";
|
|
|
|
const store = (set) => ({
|
|
clickedPointConfig: null,
|
|
|
|
setClickedPointConfig: (id, shouldSelect = false) => {
|
|
set((state) => {
|
|
if (id === null) {
|
|
state.clickedPointConfig = null;
|
|
return state;
|
|
}
|
|
state.clickedPointConfig = {
|
|
id,
|
|
shouldSelect,
|
|
};
|
|
});
|
|
},
|
|
});
|
|
|
|
export const useClickedPointConfig = create(immer(store));
|