cordova-elm-template-jumpstart
Version:
Cordova template to jumpstart development using Elm and Webpack
21 lines (18 loc) • 473 B
JavaScript
import Promise from "bluebird";
import {isFunction} from "lodash";
import ga from "./ga.js";
const handleError = e => {
if(isFunction(e.preventDefault)) {
e.preventDefault();
}
if(IS_DEV) {
console.error(e);
}
};
window.addEventListener("error", handleError);
window.addEventListener("unhandledrejection", handleError);
module.exports = ga.then(() => {
if(GOOGLE_TRACKING_ID) {
window.ga.enableUncaughtExceptionReporting(true);
}
}).return(true);