Skip to content

Instantly share code, notes, and snippets.

@hoorayimhelping
Last active February 11, 2020 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoorayimhelping/19491ce537da35678ab1b4fa3483f856 to your computer and use it in GitHub Desktop.
Save hoorayimhelping/19491ce537da35678ab1b4fa3483f856 to your computer and use it in GitHub Desktop.
import amplitude from 'amplitude-js'
import {AMPLITUDE_API_KEY} from 'src/shared/constants'
class Event {
constructor() {
this.amplitude = amplitude.getInstance()
if (ENABLE_AMPLITUDE) {
this.amplitude.init(AMPLITUDE_API_KEY)
}
}
fireEvent(eventType: string): void {
if (ENABLE_AMPLITUDE) {
this.amplitude.logEvent(eventType)
}
}
}
const event = new Event()
export {event}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment