Use when for hook conditions.