class Promise[T] extends Object
mpromise - Promises A+ conformant implementation
- Annotations
- @RawJSType() @native() @JSImport( "mpromise" , JSImport.Namespace )
- Alphabetic
- By Inheritance
- Promise
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Promise(fn: Function = js.native)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
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
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
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.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fulfill(result: T): Unit
Fulfills the promise
Fulfills the promise
- result
the given result
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
onFulfill(callback: Function1[T, Any]): Unit
Called when the promise has been fulfilled.
Called when the promise has been fulfilled.
- callback
the callback
-
def
onReject(callback: Function1[String, Any]): Unit
Called if the promise has been rejected.
Called if the promise has been rejected.
- callback
the callback
-
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
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
reject(reason: String): Unit
Rejects a promise with a reason
Rejects a promise with a reason
- reason
the given reason
-
def
resolve(reason: String, args: Any*): Unit
Resolves the promise
Resolves the promise
- reason
the given reason
- args
the optional arguments
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
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
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )