when
Add a task to run when the state is equal to the given state.
For Kotlin users, calling this method can be done with the notation `when`
(see here), or by calling the alias on
.
Return
this task
Parameters
state
the state to run the task on
task
the task to run