cps.monads.jsfuture
package cps.monads.jsfuture
Members list
Type members
Classlikes
class JSFuture[T](val executorOrUndef: UndefOr[Function2[Function1[T | Thenable[T], _], Function1[Any, _], _]], val futureOrUndef: UndefOr[Future[T]]) extends Promise[T]
JSFuture is a class, which can be represented on the js-side as a JSPromise and on the scala side - as a Future.
JSFuture is a class, which can be represented on the js-side as a JSPromise and on the scala side - as a Future.
@JSExportTopLevel("FromScalaExample")
object FromScalaExample:
@JSExport
def myFunction(x: String): JSFuture[String] = async[JSFuture] {
.....
}
I.e. in the example above we can use FromScalaExample.myFunction("x") as JS-function which return ps.Promise and inside async use usual async/await monadic API.
Attributes
- Companion
- object
- Source
- JSFuture.scala
- Supertypes
-
class Promise[T]trait Thenable[T]class Objecttrait Anyclass Objecttrait Matchableclass AnyShow all
object JSFuture
Attributes
- Companion
- class
- Source
- JSFuture.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
JSFuture.type
object JSFutureExecutor
Attributes
- Source
- JSFuture.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
JSFutureExecutor.type
In this article