Files
explore/lib/mixpanel/logEvent.ts
T
tom goriunovandGitHub e3551038af app feature list (#1079)
* metadata helpers and values for txs pages

* update titles to the rest of the pages

* refactor getServerSideProps

* dynamically update metadata for token and dapp page

* test

* 404 error page

* make new config

* make use of new config, delete old one

* feature reporter: dev implementation

* feature reporter: docker integration

* resctructure ENVS.md

* sentry feature

* refinements

* add spaces between sections

* tweaks

* switch to camelCase

* clean up

* remove NEXT_PUBLIC_NETWORK_TOKEN_ADDRESS

* v
2023-08-09 15:39:36 -04:00

20 lines
512 B
TypeScript

import mixpanel from 'mixpanel-browser';
import config from 'configs/app';
import type { EventTypes, EventPayload } from './utils';
type TrackFnArgs = Parameters<typeof mixpanel.track>;
export default function logEvent<EventType extends EventTypes>(
type: EventType,
properties?: EventPayload<EventType>,
optionsOrCallback?: TrackFnArgs[2],
callback?: TrackFnArgs[3],
) {
if (!config.features.mixpanel.isEnabled) {
return;
}
mixpanel.track(type, properties, optionsOrCallback, callback);
}