Skip to content

Latest commit

 

History

History
36 lines (35 loc) · 2.04 KB

Promise.md

File metadata and controls

36 lines (35 loc) · 2.04 KB

Object: "promises".Promise

Type parameters: Value
Extends: PromiseState of Value
A Promise<Value> supports basic composition and registration of handlers that are called when the promise is fulfilled. When multiple handlers are registered with done(), fail(), or always(), they are called in the same order.

Functions
  • then( f Function... ) Promise...
    Types Parameters: T2
    Returns a promise that represents a promise chain that consists of this promise and the promise that is returned by the function provided. The function receives the value of this promise as soon it is resolved. If this promise fails, the function is never called and the returned promise will also fail.
  • then( f Function... ) Promise...
    Types Parameters: T2
    Returns a promise that represents a promise chain that consists of this promise and the promise that is returned by the function provided. The function receives the value of this promise as soon it is resolved. If this promise fails, the function is never called and the returned promise will also fail.
    • f - Function(v Value) T2
    • return - Promise of T2
  • done( f Function... ) Promise...
    • f - Function(v Value)
    • return - Promise of Value
  • fail( f Function... ) Promise...
  • always( f Function... ) Promise...