Took a dive into the mobileweb SDK. Having trouble figuring out what exactly this deferStart function is for... some of the wrappers I'm attempting to use are getting stuck. Why wait until waiting.length is null instead of just using require?
deferStart: function() { if (loaded) { console.warn("app.js already loaded!"); } else { var n = Math.round(Math.random()*1e12); waiting.push(n); return function() { var p = waiting.indexOf(n); ~p && waiting.splice(p, 1); loaded = 1; waiting.length || require(cfg.main || ["app.js"]); }; } }
1 Answer
Accepted Answer
Ti.deferStart() is a Mobile Web internal function I wrote that allows different systems (including modules) to initialize before app.js is executed.
Say you have a module that needs to asynchronously fetch some external dependencies, all it needs to do is call Ti.deferStart(), then when the dependencies have been resolved, execute the function returned by deferStart().
This is being used by the Google Maps implementation. They have their own async loading code and when it loads (or fails to load), the defer start handle will still be called.
This function will be renamed to Ti._deferStart() in a future release, probably v2.1.1.
Your Answer
This question has been locked and cannot accept new answers.