Class

io.scalajs.npm.mpromise

Promise

Related Doc: package mpromise

Permalink

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)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def chain[U](promise: Promise[U]): Promise[U]

    Permalink

    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

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

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def fulfill(result: T): Unit

    Permalink

    Fulfills the promise

    Fulfills the promise

    result

    the given result

  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. def onFulfill(callback: Function1[T, Any]): Unit

    Permalink

    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

    Permalink

    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

    Permalink

    Called when the promise has been resolved.

    Called when the promise has been resolved.

    callback

    the callback

  23. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  24. def reject(reason: String): Unit

    Permalink

    Rejects a promise with a reason

    Rejects a promise with a reason

    reason

    the given reason

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

    Permalink

    Resolves the promise

    Resolves the promise

    reason

    the given reason

    args

    the optional arguments

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def then[U](callback: Function1[T, U], onFailure: Function1[Error, Any] = js.native): Promise.this.type

    Permalink

    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

    Permalink
    Definition Classes
    Object
  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  31. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped