Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Promise<R>

Type parameters

  • R

Hierarchy

Index

Methods

Methods

catch

  • catch<U>(onRejected?: function): Promise<U>
  • Sugar for promise.then(undefined, onRejected)

    Type parameters

    • U

    Parameters

    • Optional onRejected: function

      called when/if "promise" rejects

    Returns Promise<U>

then

  • then<U>(onFulfilled?: function, onRejected?: function): Promise<U>
  • onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. Both callbacks have a single parameter , the fulfillment value or rejection reason. "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. If an error is thrown in the callback, the returned promise rejects with that error.

    Type parameters

    • U

    Parameters

    • Optional onFulfilled: function

      called when/if "promise" resolves

    • Optional onRejected: function

      called when/if "promise" rejects

    Returns Promise<U>

Generated using TypeDoc