Packages

package callback

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. callback
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final class AsyncCallback[+A] extends AnyVal

    Pure asynchronous callback.

    Pure asynchronous callback.

    You can think of this as being similar to using Future - you can use it in for-comprehensions the same way - except AsyncCallback is pure and doesn't need an ExecutionContext.

    When combining instances, it's good to know which methods are sequential and which are parallel (or at least concurrent).

    The following methods are sequential: - >>=() / flatMap() - >>() & <<() - flatTap()

    The following methods are effectively parallel: - *>() & <*() - race() - zip() & zipWith() - AsyncCallback.traverse et al

    In order to actually run this, or get it into a shape in which in can be run, use one of the following: - toCallback <-- most common - asCallbackToFuture - asCallbackToJsPromise - unsafeToFuture() - unsafeToJsPromise()

    A good example is the [Ajax 2 demo](https://japgolly.github.io/scalajs-react/#examples/ajax-2).

    A

    The type of data asynchronously produced on success.

  2. type Callback = CallbackTo[Unit]
  3. final class CallbackOption[+A] extends AnyVal

    Callback that can short-circuit along the way when conditions you specify, aren't met.

    Callback that can short-circuit along the way when conditions you specify, aren't met.

    Especially useful for event handlers such as key handlers, drag-and-drop handlers, etc, where you check a condition, perform an effect, check another condition, perform another effect, etc.

    This is meant to be lightweight, and be immediately useful without the typical pain of imports, implicit conversions and extension methods then normally accompany monad transforms in Scala.

    For a more generic (i.e. beyond Option) or comprehensive monad transformer use Cats or similar.

  4. final class CallbackTo[+A] extends AnyVal

    A function to be executed later, usually by scalajs-react in response to some kind of event.

    A function to be executed later, usually by scalajs-react in response to some kind of event.

    The purpose of this class is to lift effects into the type system, and use the compiler to ensure safety around callbacks (without depending on an external library like Cats).

    () => Unit is replaced by Callback. Similarly, ReactEvent => Unit is replaced by ReactEvent => Callback.

    A

    The type of result produced when the callback is invoked.

    Since

    0.10.0

  5. trait Exports extends AnyRef
  6. final class SyncPromise[A] extends AnyRef

    Promise that is synchronous once its value has been set.

  7. trait Timer extends AnyRef
  8. sealed trait Trampoline[+A] extends AnyRef

Value Members

  1. object AsyncCallback
  2. object Callback

    A callback with no return value.

    A callback with no return value. Equivalent to () => Unit.

    See also

    CallbackTo

  3. object CallbackOption
  4. object CallbackTo
  5. object RateLimit
  6. object SyncPromise
  7. object Timer
  8. object Trampoline

Inherited from AnyRef

Inherited from Any

Ungrouped