when
Add a task to run when the state is equal to the given state.
Return
this task
Parameters
state
the state to run the task on
task
the task to run
Add a task to run when the state is equal to the given state.
this task
the state to run the task on
the task to run