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