-
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
onProgress
is not a function- It is ignored
- If the
onProgress
is a function- When progress is emitted, the
onProgress
is called with theProgressValue
as the first argument. - If the
onProgress
throws an exception with a.name
property 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. onProgress
is 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