You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add deferred executor, support chaining (#4) (1fe382e)
Deferred promises are now implemented via the deferred
executor function. There are no changes to the existing public API.
Changes
Supports Promise chaining.
Adds createDeferredExecutor to use this library with any Promise.
Improves type annotations in regard to what the deferred promise
expects as the input and what is the promise's output:
constp=newDeferredPromise<number>().then(()=>'hello')// The input must be "number".p.resolve(5)// the output is "string"// (the result of the "then" chain)awaitp// "hello"
Deprecated: Removes DeferredPromise.result. Access the result by
awaiting the promise instead.
Deprecated: The resolved promise state is replaced by fulfilled, which is the correct promise state representation per
specification.