Packages

class Promise[T] extends Object

mpromise - Promises A+ conformant implementation

Annotations
@RawJSType() @native() @JSImport( "mpromise" , JSImport.Namespace )
Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Promise
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Promise(fn: Function = js.native)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def chain[U](promise: Promise[U]): Promise[U]

    Allows direct promise to promise chaining (especially useful by a outside aggregating function).

    Allows direct promise to promise chaining (especially useful by a outside aggregating function). It doesn't use the asynchronous resolve algorithm and so excepts only another Promise as it's argument.

    promise

    the promise to chain

    returns

    a new promise

  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def end(): Unit

    Signifies that this promise was the last in a chain of then()s: if a handler passed to the call to then which produced this promise throws, the exception be rethrown.

    Signifies that this promise was the last in a chain of then()s: if a handler passed to the call to then which produced this promise throws, the exception be rethrown. You can pass an OnReject handler to end so that exceptions will be handled (like a final catch clause); This method returns it's promise for easy use with return.

  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def fulfill(result: T): Unit

    Fulfills the promise

    Fulfills the promise

    result

    the given result

  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  13. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  20. def onFulfill(callback: Function1[T, Any]): Unit

    Called when the promise has been fulfilled.

    Called when the promise has been fulfilled.

    callback

    the callback

  21. def onReject(callback: Function1[String, Any]): Unit

    Called if the promise has been rejected.

    Called if the promise has been rejected.

    callback

    the callback

  22. def onResolve(callback: Function2[Error, T, Any]): Unit

    Called when the promise has been resolved.

    Called when the promise has been resolved.

    callback

    the callback

  23. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  24. def reject(reason: String): Unit

    Rejects a promise with a reason

    Rejects a promise with a reason

    reason

    the given reason

  25. def resolve(reason: String, args: Any*): Unit

    Resolves the promise

    Resolves the promise

    reason

    the given reason

    args

    the optional arguments

  26. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  27. def then[U](callback: Function1[T, U], onFailure: Function1[Error, Any] = js.native): Promise.this.type

    Creates a new promise and returns it.

    Creates a new promise and returns it. If onFulfill or onReject are passed, they are added as SUCCESS/ERROR callbacks to this promise after the nextTick.

    callback

    the callback

  28. def toLocaleString(): String
    Definition Classes
    Object
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. def valueOf(): Any
    Definition Classes
    Object
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped