Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
import { create } from 'zustand';
const store = create(() => ({}));
const useGlobalState = (key: string, value?: any) => {
if (value !== undefined && store.getState()[key] === undefined) {
store.setState({ [key]: value });
}
return [store(state => state[key]), (value: any) => store.setState({ [key]: value })];
};
export { useGlobalState };