Negates the callback result (so long as it's boolean).
Creates a new callback that returns true
when both this and the given callback return true
.
Alias for >>
.
Alias for >>
.
Where >>
is often associated with Monads, *>
is often associated with Applicatives.
Sequence actions, discarding the value of the second argument.
Sequence a callback to run before this, discarding any value produced by it.
Sequence a callback to run before this, discarding any value produced by it.
Alias for tap
.
Alias for tap
.
Same as flatMap
and >>=
, but allows arguments to appear in reverse order.
Same as flatMap
and >>=
, but allows arguments to appear in reverse order.
i.e. f >>= g
is the same as g =<<: f
Sequence a callback to run after this, discarding any value produced by this.
Alias for flatMap
.
Alias for flatMap
.
Run asynchronously.
Wraps this callback in a try-catch and returns either the result or the exception if one occurs.
Wraps this callback in a scala Try
with catches what it considers non-fatal errors.
Wraps this callback in a scala Try
with catches what it considers non-fatal errors.
Use attempt to catch everything.
Run asynchronously after a delay of a given duration.
Run asynchronously after a startInMilliseconds
ms delay.
Wraps this callback in a try-finally
block and runs the given callback in the finally
clause, after the
current callback completes, be it in error or success.
Log to the console before this callback starts, and after it completes.
Log to the console before this callback starts, and after it completes.
Does not change the result.
Log the duration of this callback's execution.
Log the duration of this callback's execution.
Log the duration of this callback's execution.
Prefix to appear the log output.
Log the duration of this callback's execution.
Logs the result of this callback as it completes.
Logs the result of this callback as it completes.
Logs the result of this callback as it completes.
Prefix to appear the log output.
Logs the result of this callback as it completes.
Convenience-method to run additional code before this callback.
Discard the callback's return value, return a given value instead.
Discard the callback's return value, return a given value instead.
ret
, short for return
.
Executes this callback, on the current thread, right now, blocking until complete.
Executes this callback, on the current thread, right now, blocking until complete.
In most cases, this type is passed to scalajs-react such that you don't need to call this method yourself.
Exceptions will not be caught. Use attempt to catch thrown exceptions.
When the callback result becomes available, perform a given side-effect with it.
Convenience-method to run additional code after this callback.
Schedules an instance of this callback to run asynchronously.
Conditional execution of this callback.
Conditional execution of this callback. Reverse of when().
The condition required to be false
for this callback to execute.
Some
result of the callback executed, else None
.
Conditional execution of this callback.
Conditional execution of this callback. Discards the result. Reverse of when_().
The condition required to be false
for the callback to execute.
Discard the value produced by this callback.
Discard the value produced by this callback.
Discard the value produced by this callback.
This method allows you to be explicit about the type you're discarding (which may change in future).
Conditional execution of this callback.
Conditional execution of this callback.
The condition required to be true
for this callback to execute.
Some
result of the callback executed, else None
.
Conditional execution of this callback.
Conditional execution of this callback. Discards the result.
The condition required to be true
for this callback to execute.
Record the duration of this callback's execution.
Alias for map
.
Alias for map
.
Creates a new callback that returns true
when either this or the given callback return true
.
(Since version 0.11.0) Use when() or unless().
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 byCallback
. Similarly,ReactEvent => Unit
is replaced byReactEvent => Callback
.The type of result produced when the callback is invoked.
0.10.0