UNPKG

cordova-elm-template-jumpstart

Version:

Cordova template to jumpstart development using Elm and Webpack

19 lines (16 loc) 450 B
/* * Require Cordova's "deviceready" event to have fired before we continue ourselves ready to go, * and provide access to 'window.device'. * * */ import Promise from "bluebird"; module.exports = new Promise( (resolved) => document.addEventListener("deviceready", () => { const device = window.device; if(device) { resolved(device) } else { throw new Error("No device found on the window object") } }), false );