Дата: 10-04-2023, 14:28
One of the things I've poured myself into this yr -- with a merry band of contributors together with Domenic Denicola, Anne van Kesteren, Jake Archibald, Mark Miller, Erik Arvidsson, and lots of others -- has been a design for Promises that DOM and JS can both adopt. There is a (very) lengthy history of Guarantees, Deferreds, and numerous different Promise-ish things in JS which I won't bore you with here except to note that there are very few client-facet libraries which do not embody such a thing and use it as a core idiom for dealing with async behvaior (e.g., XHR). Query, Dojo, Q, WinJS, Cujo, Closure, YUI, Ember (by way of RSVP), and all the rest use this style of contract pervasively and have for years. The major libraries are coalescing round that contract and so it appears time, finally, to make our largest and most important library -- DOM -- savvy to them too.