japgolly.scalajs.react.callback
Members list
Type members
Classlikes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
AsyncCallback.type
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:
The following methods are effectively parallel:
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.
Type parameters
- A
-
The type of data asynchronously produced on success.
Attributes
- Companion
- object
- Supertypes
-
class AnyValtrait Matchableclass Any
- Self type
A callback with no return value. Equivalent to () => Unit
.
A callback with no return value. Equivalent to () => Unit
.
Attributes
- See also
-
CallbackTo
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Callback.type
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CallbackOption.type
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.
Attributes
- Companion
- object
- Supertypes
-
class AnyValtrait Matchableclass Any
- Self type
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CallbackTo.type
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
.
Type parameters
- A
-
The type of result produced when the callback is invoked.
Attributes
- Since
-
0.10.0
- Companion
- object
- Supertypes
-
class AnyValtrait Matchableclass Any
- Self type
-
CallbackTo[A]
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
RateLimit.type
Promise that is synchronous once its value has been set.
Promise that is synchronous once its value has been set.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
SyncPromise.type