I am using requirejs in my WinJS app and also use WinJS.UI.Pages. I understand that all the Pages methods are supposed to return a promise or nothing.
WinJS.UI.Pages.define("/pages/fileOpenPicker.html", {
ready: function (element, options) {
require(["log"], function (log) {
});
}
});
The ready call is returned immediately, since require works asynchronously. I assume if I return a Promise here the page would wait for the promise to finish and not be displayed. So the way I do it now is actually better, since the page is displayed but
only when require calls my callback I fill the page with useful data.
Opinions?