WinJS Promises and JQuery Promises are the same thing?
Asked
Active
Viewed 310 times
-7
-
3What is your question? – Sampson Jan 15 '14 at 13:43
-
1Just search in your favorite search engine for ` JS promises ` [has been asked before](http://stackoverflow.com/questions/6801283/what-are-the-differences-between-deferred-promise-and-future-in-javascript?lq=1) – Philipp Gayret Jan 15 '14 at 13:45
-
1Their purpose is the same, the work 'a little' different. http://blogs.realdolmen.com/experts/2012/08/09/promises-jquery-deferred-object-vs-winjs-promise/ Dude, you need to ask a real question and google around a bit before posting here. – sebagomez Jan 15 '14 at 14:20
-
1Parse.com uses promises and has some good docs explaining how they work. Hope this helps: https://parse.com/docs/js_guide#promises – bmurmistro Jan 15 '14 at 14:36
1 Answers
2
Promises are a programming pattern for dealing with asynchronous operations. The pattern could be applied to other languages, but they are most commonly encountered in JS libraries (like jQuery and WinJS).
Kraig Brockschmidt has a really good blog post about how they work (in general) and in WinJS here: http://blogs.msdn.com/b/windowsappdev/archive/2013/06/11/all-about-promises-for-windows-store-apps-written-in-javascript.aspx
I've written a blog post comparing jQuery promises and promises in WinJS. The short answer: they're interoperable. http://blogs.windows.com/windows/b/appbuilder/archive/2013/07/10/jquery-and-winjs-working-together-in-windows-store-apps.aspx

Eric Schmidt
- 312
- 1
- 11
-
They're not completely compatible, since jQuery has always() and fail() methods. $.Deferred().reject() doesn't result in a call to the error handler on a WinJS Promise either. – Tom McKearney Feb 03 '14 at 18:59
-
You can do some of the basics with WinJS and jQuery promises - chaining, joining. I didn't know about $.Deferred().reject(), so thank you! – Eric Schmidt Feb 03 '14 at 20:10