Last active
February 11, 2020 23:26
-
-
Save hoorayimhelping/19491ce537da35678ab1b4fa3483f856 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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