object Callback
A callback with no return value. Equivalent to () => Unit
.
- See also
CallbackTo
- Alphabetic
- By Inheritance
- Callback
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final class ResultGuard[A] extends AnyRef
- Annotations
- @implicitNotFound()
- final class SetIntervalResult extends AnyRef
- final class SetTimeoutResult extends AnyRef
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
- def alert(message: String): Callback
Convenience for calling
dom.alert
. - def apply[U](f: => U)(implicit arg0: ResultGuard[U]): Callback
- Annotations
- @inline()
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def assert(test: Boolean, message: String, optionalParams: Any*): Callback
Convenience for calling
dom.console.assert
. - def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def debounce(delay: FiniteDuration): Callback
Creates an debounce boundary.
Creates an debounce boundary.
Save it as a
val
somewhere because it relies on internal state that must be reused.- Annotations
- @inline()
- def debounce(delay: Duration): Callback
Creates an debounce boundary.
Creates an debounce boundary.
Save it as a
val
somewhere because it relies on internal state that must be reused.- Annotations
- @inline()
- def debounceMs(delayMs: Long): Callback
Creates an debounce boundary.
Creates an debounce boundary.
Save it as a
val
somewhere because it relies on internal state that must be reused.- Annotations
- @inline()
- val empty: Callback
A callback that does nothing.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fromJsFn(f: Function0[Unit]): Callback
- Annotations
- @inline()
- def future[A](f: => Future[CallbackTo[A]])(implicit ec: ExecutionContext): Callback
Wraps a Future so that it is repeatable, and so that its inner callback is run when the future completes.
Wraps a Future so that it is repeatable, and so that its inner callback is run when the future completes.
The result is discarded. To retain it, use CallbackTo.future instead.
Because the
Future
is discarded, when an exception causes it to fail, the exception is re-thrown. If you want the exception to be ignored or handled differently, use CallbackTo.future instead and then.void
to discard the future and turn the result into aCallback
.WARNING: Futures are scheduled to run as soon as they're created. Ensure that the argument you provide creates a new Future; don't reference an existing one.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def info(message: Any, optionalParams: Any*): Callback
Convenience for calling
dom.console.info
. - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lazily(f: => Callback): Callback
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.
- Annotations
- @inline()
- def lift(f: () => Unit): Callback
- Annotations
- @inline()
- def log(message: Any, optionalParams: Any*): Callback
Convenience for calling
dom.console.log
. - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def runAll(callbacks: CallbackTo[Any]*): Callback
Run all given callbacks.
Run all given callbacks.
All results are discarded. Any exceptions get a
printStackTrace
and are then discarded, and the next callback run.- Since
2.0.0
- def sequence[T[X] <: Iterable[X], A](tca: => T[CallbackTo[A]]): Callback
- def sequenceOption[A](oca: => Option[CallbackTo[A]]): Callback
- def suspend(f: => Callback): Callback
Callback that is recreated each time it is used.
Callback that is recreated each time it is used.
- Annotations
- @inline()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def throwException(t: Throwable): Callback
- Annotations
- @inline()
- def toString(): String
- Definition Classes
- AnyRef → Any
- def traverse[T[X] <: Iterable[X], A, B](ta: => T[A])(f: (A) => CallbackTo[B]): Callback
- def traverseOption[A, B](oa: => Option[A])(f: (A) => CallbackTo[B]): Callback
- def unless[A](cond: Boolean)(c: => CallbackTo[A]): Callback
Convenience for applying a condition to a callback, and returning
Callback.empty
when the condition is already satisfied.Convenience for applying a condition to a callback, and returning
Callback.empty
when the condition is already satisfied.Notice the condition is strict. If non-strictness is desired use
callback.unless(cond)
.- cond
The condition required to be
false
for the callback to execute.
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def warn(message: Any, optionalParams: Any*): Callback
Convenience for calling
dom.console.warn
. - def when[A](cond: Boolean)(c: => CallbackTo[A]): Callback
Convenience for applying a condition to a callback, and returning
Callback.empty
when the condition isn't satisfied.Convenience for applying a condition to a callback, and returning
Callback.empty
when the condition isn't satisfied.Notice the condition is strict. If non-strictness is desired use
callback.when(cond)
.- cond
The condition required to be
true
for the callback to execute.
- object ResultGuard
Deprecated Value Members
- def TODO(reason: => String): Callback
Serves as a temporary placeholder for a callback until you supply a real implementation.
Serves as a temporary placeholder for a callback until you supply a real implementation.
Unlike
???
this doesn't crash, it just prints a warning to the console.Also it's not really deprecated; that's just so you get a compiler warning as a reminder.
- Annotations
- @deprecated
- Deprecated
(Since version not really deprecated)
- def TODO: Callback
Serves as a temporary placeholder for a callback until you supply a real implementation.
Serves as a temporary placeholder for a callback until you supply a real implementation.
Unlike
???
this doesn't crash, it just prints a warning to the console.Also it's not really deprecated; that's just so you get a compiler warning as a reminder.
- Annotations
- @deprecated
- Deprecated
(Since version not really deprecated)
- def byName(f: => Callback): Callback
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
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.0.0) Use Callback.suspend
- def error(t: Throwable): Callback
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 1.6.1) use throwException
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated