Action Runner

A class to run one or several callbacks in a loop. The speed from one iteration to next can be set in milliseconds; the whole loop can be paused.

If multiple actions were added, each is executed once (in the order of addition) before the whole list is repeated. If an action callback returns false it is repeated before advancing the list of actions.

In this example, two actions – Action A and Action B are added to the action runnner. The Action A returns false until a counter reaches 3 and thus is repeated three times before passing on to Action B.