jQuery vs. Promises/A
In terms of capabilities, jQuery Promises and Promises/A are nearly identical. Q.js, the most popular Promises/A library, even offers methods that can work with jQuery Promises. The differences are superficial; they use the same words to mean different things.
As previously mentioned in âMaking Promisesâ, jQuery uses the term resolve as the opposite of fail, whereas Promises/A uses fulfill. Under Promises/A, a Promise is said to be âresolvedâ when itâs either fulfilled or failed.
Up until the release of 1.8, jQueryâs then method was just a shorthand for invoking done, fail, and progress simultaneously, while Promises/Aâs then acted more like jQueryâs pipe. jQuery 1.8 corrected this by making then a synonym ...
Get Async JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.