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
409 B

import { create } from "zustand";
import { immer } from "zustand/middleware/immer";
const store = (set) => ({
popup: null,
setPopup: (feature) => {
set((state) => {
if (!feature) {
state.popup = null;
return state;
}
state.popup = {
feature,
coordinates: feature.coordinates,
};
});
},
});
export const usePopup = create(immer(store));