Sending a Corvette on a list of errands—extending a class with a chain

To gain some familiarity with how chains work, look in Chapter 7, Knock And the Door Will Open: Events and Listeners for more chaining recipes that do not include the minor complexity of Implements.

Getting ready

Create a canvas where the tasks completed can be written and a trigger to fire each task.

<h1>Taskinator:</h1>
<form action="" method="get">
<input type="button" value="Do Next Task!" id="taskinator"/>
</form>
<h1>Items Done:</h1>
<div id="itemsdone"></div>

How to do it...

  1. Implement the chain
  2. Load the chain with actions
  3. Fire off the actions in the chain

Follow these steps:

  1. Create a class that implements Chain with a method that will append a new action to the class's internal ...

Get MooTools 1.3 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.