Skip to content

Instantly share code, notes, and snippets.

@tgvashworth
Created May 20, 2013 20:20
Show Gist options
  • Select an option

  • Save tgvashworth/5615180 to your computer and use it in GitHub Desktop.

Select an option

Save tgvashworth/5615180 to your computer and use it in GitHub Desktop.
// io.js
define(['jquery'], function ($) {
return $({});
});
...
// main.js
require(['io', 'toast'], function (io, toast) {
io.on('my_event', function () {});
io.trigger('loadAThing')
})
...
// toast.js
define(['io'], function (io) {
io.on('loadAThing', function () {
... // load the thingd
});
io.trigger('my_event')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment