Skip to content

Instantly share code, notes, and snippets.

@pegli
Created June 26, 2012 15:39
Show Gist options
  • Save pegli/2996514 to your computer and use it in GitHub Desktop.
Save pegli/2996514 to your computer and use it in GitHub Desktop.
postal.js and machina.js in Titanium
// setting up postal and machina to work together
/*
1. Download underscore.js and the node versions of postal.js, machina.js, and machina-postal.js
from http://github.com/ifandelse
2. Change the location of underscore in the require() statements of the postal.js and machina.js
3. Connect machina to postal as follows:
*/
var postal = require('lib/ifandelse/postal'),
machina = require('lib/ifandelse/machina');
require('lib/ifandelse/machina.postal')(postal, machina);
/*
Now you can create a state machine as shown on the machina.js or machina.postal READMEs which
publishes events to the postal message bus.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment