-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
This has lots of holes in it, I'm putting it here though, because I'm hoping that we'll start to see where the holes are and fill some of them in a little.
Progress/A+
This proposal specifies how progress is triggered and propagated in a PromisesA+ promise library.
Requirements
The then method
The then method is the same as that specified in the promises-spec except that it also takes a third argument. We'll call that third argument the onProgress.
The onProgress
- If the
onProgressis not a function- It is ignored
- If the
onProgressis a function- When progress is emitted, the
onProgressis called with theProgressValueas the first argument. - If the
onProgressthrows an exception with a.nameproperty equal to'StopProgressPropagation'then the error is silenced and progress is not propagated. In all other cases, the result of the function is used as the progress value to propagate. onProgressis never called once a promise has already been fulfilled or rejected.
- When progress is emitted, the
The progress method
The resolver has a .progress(value) method. This triggers all the onProgress methods. It returns a promise which is fulfilled with undefined once all progress methods are complete or is rejected with the first (non-StopProgressPropagation) exception thrown by the handlers, if any.
Metadata
Metadata
Assignees
Labels
No labels