A => CallbackTo[B]
aka Kleisli[CallbackTo, A, B]
aka ReaderT[A, CallbackTo, B]
.
A => CallbackTo[B]
aka Kleisli[CallbackTo, A, B]
aka ReaderT[A, CallbackTo, B]
.
Never heard of Kleisli? Basically, a "Kleisli triple" is a function with the shape A => M[B]
.
In this case, the M
is hard-coded to CallbackTo
.
This is hard-coded to CallbackTo
for the same reasons as CallbackOption
and for the same reasons that CallbackTo exists.
1.2.0
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 Scalaz or similar.
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 Scalaz).
() => Unit
is replaced by Callback
.
Similarly, ReactEvent => Unit
is replaced by ReactEvent => Callback
.
The type of result produced when the callback is invoked.
0.10.0
Describes how a component uses .props.children
.
Extensions to plain old DOM.
Extensions to plain old DOM.
Base class for something that has read/write state access (under the same effect type).
Base class for something that has read/write state access (under the same effect type).
Passing this around (top-level) is fine but do not use it in a generic/library/helper method. In intermediary positions, use StateAccessor instead.
The type of effect when accessing state.
State type.
A callback with no return value.
A callback with no return value. Equivalent to () => Unit
.
CallbackTo
Type-classes that provide read and/or write access to state.
Type-classes that provide read and/or write access to state.
The syntax is a little wonky for technical reasons.
For read access, it's typeclass.state(i): F[S]
.
For write access, it's typeclass(i).setState(...): F[Unit]
.
See https://flow.org/en/docs/react/types