Created
May 29, 2012 14:21
-
-
Save andreabalducci/2828710 to your computer and use it in GitHub Desktop.
winjs update context wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// knockout mapping | |
UpdateContext.Execute(function(){ | |
ko.applyBindings(viewmodel); | |
viewmodel.load(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (){ | |
var UpdateContext = window.UpdateContext = window.UpdateContext || {}; | |
var isWinJS = typeof(MSApp) != 'undefined'; | |
if(isWinJS){ | |
UpdateContext.Execute = function(cb){ | |
MSApp.execUnsafeLocalFunction(cb); | |
}; | |
}else{ | |
UpdateContext.Execute = function(cb){ | |
cb.call(); | |
}; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment