Create state machine components effortlessly by using generators and yield.