100-lines-of-code-challenge-js icon indicating copy to clipboard operation
100-lines-of-code-challenge-js copied to clipboard

Deferred race

Open cyan33 opened this issue 8 years ago • 2 comments

A few things that I feel quite confused:

  1. What's the meaning of once here?
  2. Is it necessary that in Deferred.all().then() we should get all of the results returned by each deferred instance?

cyan33 avatar Nov 19 '17 04:11 cyan33

@thomasyimgit Thanks for it.

  1. tiny-deferred is from jQuery.deferred, it based on jQuery.Callback. once method is one of the flags from the Callback, actually I don't remember it's useful in deferred, maybe we should delete it at some time.
  2. yes, you are right. The return value for each promise instance should as a parameter to next fullfilled function or rejected function.That is my mistake, I create the tiny-deferred at about 1 year ago, at that time, I just want it work as simple, don't thinking too much of it. Sorry about that.

revan-zhang avatar Nov 19 '17 11:11 revan-zhang