Choose a Demo

Scenario: we're signing a user in (or up) after receiving an OAuth token, which involves several calls to an outside service.

In this demo, the user has never signed up for our service before, so they have to accept the terms & conditions before the server signs them in. We do this in our "success" handler by triggering an error to stop trafficlight (this keeps us on the first step); when the user has accepted the terms, we update the Ajax arguments and resume.

In this demo, we try to call our remote service, but it times out (an automatic error). We retry once, but it fails again, so we tell the user to come back later.

In this demo, we ask the user for some information when signing them in. This is similar to the first demo, but instead of erroring and redoing the first step, we use the pause method and continue on with the second step.

Thanks to 1RadicalOne for sharing his cool icons via the Creative Commons license.
Check out the source of this page for an example of how to implement Trafficlight. (More documentation coming.)
Trafficlight on Github | Trafficlight tests (incomplete)