Tests whether this object has the specified property as a direct property.
Tests whether this object has the specified property as a direct property.
Unlike js.Object.hasProperty, this method does not check down the object's prototype chain.
MDN
Tests whether this object is in the prototype chain of another object.
Tests whether this object is in the prototype chain of another object.
Tests whether the specified property in an object can be enumerated by a call to js.Object.properties, with the exception of properties inherited through the prototype chain.
Tests whether the specified property in an object can be enumerated by a call to js.Object.properties, with the exception of properties inherited through the prototype chain. If the object does not have the specified property, this method returns false.
MDN
Converts the Thenable into a Scala Future.
Converts the Thenable into a Scala Future.
Unlike when calling the then
methods of Thenable, the resulting
Future is always properly typed, and
operations on it will be well-typed in turn.
ECMAScript 6 Promise of an asynchronous result.
Attention! The nature of this class, from the ECMAScript specification, makes it inherently un-typeable, because it is not type parametric.
The signatures of the constructor and the methods
then
andcatch
are only valid provided that the values ofA
andB
are not Thenables.We recommend to use Scala's
Future
s instead ofPromise
as much as possible. APromise
can be converted to aFuture
with.toFuture
and back with.toJSPromise
(provided by JSConverters).With
import scala.scalajs.js.Thenable.Implicits._
you can implicitly convert a
Promise
to aFuture
, and therefore you can directly use the methods ofFuture
onPromise
s.