18 lines
428 B
TypeScript
18 lines
428 B
TypeScript
type AnalyticsProperties = Record<string, unknown>;
|
|
|
|
type SafeAnalytics = {
|
|
capture: (event: string, properties?: AnalyticsProperties) => void;
|
|
identify: (userId: string, properties?: AnalyticsProperties) => void;
|
|
reset: () => void;
|
|
};
|
|
|
|
const noop = () => {};
|
|
|
|
const safeAnalytics: SafeAnalytics = {
|
|
capture: noop,
|
|
identify: noop,
|
|
reset: noop,
|
|
};
|
|
|
|
export const useSafeAnalytics = (): SafeAnalytics => safeAnalytics;
|