jiti-meet/modules/statistics/AnalyticsAdapter.js

20 lines
338 B
JavaScript
Raw Normal View History

2015-12-29 12:41:43 +00:00
class NoopAnalytics {
sendEvent () {}
2015-09-02 17:08:31 +00:00
}
2015-12-29 12:41:43 +00:00
const AnalyticsImpl = window.Analytics || NoopAnalytics;
class AnalyticsAdapter {
constructor () {
this.analytics = new AnalyticsImpl();
}
sendEvent (...args) {
try {
this.analytics.sendEvent(...args);
} catch (ignored) {}
}
}
2015-09-02 17:08:31 +00:00
2015-12-29 12:41:43 +00:00
export default new AnalyticsAdapter();