AsyncCallback

japgolly.scalajs.react.callback.AsyncCallback$
See theAsyncCallback companion class
object AsyncCallback

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final class Barrier(val await: AsyncCallback[Unit], completePromise: Callback)

Attributes

Supertypes
class Object
trait Matchable
class Any
final class CountDownLatch(count: Int, barrier: Barrier)

Attributes

Supertypes
class Object
trait Matchable
class Any
final case class Forked[+A](await: AsyncCallback[A], isComplete: CallbackTo[Boolean])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final class Mutex

Attributes

Supertypes
class Object
trait Matchable
class Any
final class ReadWriteMutex

Attributes

Supertypes
class Object
trait Matchable
class Any
final class Ref[A]

Attributes

Supertypes
class Object
trait Matchable
class Any
final class State

Attributes

Supertypes
class Object
trait Matchable
class Any

Types

type UnderlyingRepr[+A] = State => (Try[A] => Callback) => Callback

Value members

Concrete methods

def apply[A](f: (Try[A] => Callback) => Callback): AsyncCallback[A]
def awaitAll(as: AsyncCallback[Any]*): AsyncCallback[Unit]
def cancel: AsyncCallback[Unit]
inline def const[A](t: Try[A]): AsyncCallback[A]

A synchronization aid that allows you to wait until a set of async processes completes.

A synchronization aid that allows you to wait until a set of async processes completes.

Attributes

inline def debounce(delay: Duration): AsyncCallback[Unit]

Creates an debounce boundary.

Creates an debounce boundary.

Save it as a val somewhere because it relies on internal state that must be reused.

Attributes

inline def debounce(delay: FiniteDuration): AsyncCallback[Unit]

Creates an debounce boundary.

Creates an debounce boundary.

Save it as a val somewhere because it relies on internal state that must be reused.

Attributes

inline def debounceMs(delayMs: Long): AsyncCallback[Unit]

Creates an debounce boundary.

Creates an debounce boundary.

Save it as a val somewhere because it relies on internal state that must be reused.

Attributes

def delay[A](a: => A): AsyncCallback[A]
def first[A](f: (Try[A] => Callback) => Callback): AsyncCallback[A]
def fromCallbackToFuture[A](c: CallbackTo[Future[A]])(using ec: ExecutionContext): AsyncCallback[A]
def fromCallbackToJsPromise[A](c: CallbackTo[Promise[A]]): AsyncCallback[A]
def fromFuture[A](fa: => Future[A])(using ec: ExecutionContext): AsyncCallback[A]
def fromJsPromise[A](pa: => Thenable[A]): AsyncCallback[A]
def init[A, B](f: (Try[B] => Callback) => CallbackTo[A]): CallbackTo[(A, AsyncCallback[B])]
def lazily[A](f: => AsyncCallback[A]): AsyncCallback[A]

Callback that isn't created until the first time it is used, after which it is reused.

Callback that isn't created until the first time it is used, after which it is reused.

Attributes

Creates a new (non-reentrant) mutex.

Creates a new (non-reentrant) mutex.

Attributes

def never[A]: AsyncCallback[A]

AsyncCallback that never completes.

AsyncCallback that never completes.

Attributes

def promise[A]: CallbackTo[(AsyncCallback[A], Try[A] => Callback)]

Create an AsyncCallback and separately provide the completion function.

Create an AsyncCallback and separately provide the completion function.

This is like Scala's promise, not the JS promise which is more like Scala's Future.

Attributes

def pure[A](a: A): AsyncCallback[A]

Creates a new (non-reentrant) read/write mutex.

Creates a new (non-reentrant) read/write mutex.

Attributes

inline def ref[A]: CallbackTo[Ref[A]]
def ref[A](allowStaleReads: Boolean, atomicWrites: Boolean): CallbackTo[Ref[A]]
def sequence[T <: (Iterable), A](tca: => T[AsyncCallback[A]])(using cbf: BuildFrom[T[AsyncCallback[A]], A, T[A]]): AsyncCallback[T[A]]

Sequence stdlib T over AsyncCallback. Co-sequence AsyncCallback over stdlib T.

Sequence stdlib T over AsyncCallback. Co-sequence AsyncCallback over stdlib T.

Attributes

def sequenceOption[A](oca: => Option[AsyncCallback[A]]): AsyncCallback[Option[A]]

Sequence Option over AsyncCallback. Co-sequence AsyncCallback over Option.

Sequence Option over AsyncCallback. Co-sequence AsyncCallback over Option.

Attributes

def sequenceOption_[A](oca: => Option[AsyncCallback[A]]): AsyncCallback[Unit]

Same as sequenceOption except avoids combining return values.

Same as sequenceOption except avoids combining return values.

Attributes

def sequence_[T <: (Iterable), A](tca: => T[AsyncCallback[A]]): AsyncCallback[Unit]

Same as sequence except avoids combining return values.

Same as sequence except avoids combining return values.

Attributes

def suspend[A](f: => AsyncCallback[A]): AsyncCallback[A]

Callback that is recreated each time it is used.

Callback that is recreated each time it is used.

https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_name

Attributes

def tailrec[A, B](a: A)(f: A => AsyncCallback[Either[A, B]]): AsyncCallback[B]

Not literally tail-recursive because AsyncCallback is continuation-based, but this utility in this shape may still be useful.

Not literally tail-recursive because AsyncCallback is continuation-based, but this utility in this shape may still be useful.

Attributes

def throwException[A](t: => Throwable): AsyncCallback[A]
def throwExceptionWhenDefined(o: => Option[Throwable]): AsyncCallback[Unit]
def traverse[T <: (Iterable), A, B](ta: => T[A])(f: A => AsyncCallback[B])(using cbf: BuildFrom[T[A], B, T[B]]): AsyncCallback[T[B]]

Traverse stdlib T over AsyncCallback. Distribute AsyncCallback over stdlib T.

Traverse stdlib T over AsyncCallback. Distribute AsyncCallback over stdlib T.

Attributes

def traverseOption[A, B](oa: => Option[A])(f: A => AsyncCallback[B]): AsyncCallback[Option[B]]

Traverse Option over AsyncCallback. Distribute AsyncCallback over Option.

Traverse Option over AsyncCallback. Distribute AsyncCallback over Option.

Attributes

def traverseOption_[A, B](oa: => Option[A])(f: A => AsyncCallback[B]): AsyncCallback[Unit]

Same as traverseOption except avoids combining return values.

Same as traverseOption except avoids combining return values.

Attributes

def traverse_[T <: (Iterable), A, B](ta: => T[A])(f: A => AsyncCallback[B]): AsyncCallback[Unit]

Same as traverse except avoids combining return values.

Same as traverse except avoids combining return values.

Attributes

def viaCallback(onCompletion: Callback => Callback): AsyncCallback[Unit]

Deprecated methods

def byName[A](f: => AsyncCallback[A]): AsyncCallback[A]

Callback that is recreated each time it is used.

Callback that is recreated each time it is used.

https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_name

Attributes

Deprecated
true

Attributes

Deprecated
true
def point[A](a: => A): AsyncCallback[A]

Attributes

Deprecated
true

Concrete fields

A synchronisation aid that allows you to wait for another async process to complete.

A synchronisation aid that allows you to wait for another async process to complete.

Attributes

val unit: AsyncCallback[Unit]

Extensions

Extensions

extension [A, B](self: AsyncCallback[A => B])(self: AsyncCallback[A => B])
def distFn: A => AsyncCallback[B]

Function distribution. See AsyncCallback.liftTraverse(f).id for the dual.

Function distribution. See AsyncCallback.liftTraverse(f).id for the dual.

Attributes