future

What are the differences between Deferred, Promise and Future in JavaScript?

左心房为你撑大大i 提交于 2019-11-25 23:50:45
问题 What are the differences between Deferreds, Promises and Futures? Is there a generally approved theory behind all these three? 回答1: In light of apparent dislike for how I've attempted to answer the OP's question. The literal answer is, a promise is something shared w/ other objects, while a deferred should be kept private. Primarily, a deferred (which generally extends Promise) can resolve itself, while a promise might not be able to do so. If you're interested in the minutiae, then examine