Skip to content

Instantly share code, notes, and snippets.

@iaincarsberg
Created July 1, 2011 09:06
Show Gist options
  • Save iaincarsberg/1058136 to your computer and use it in GitHub Desktop.
Save iaincarsberg/1058136 to your computer and use it in GitHub Desktop.
Thorny: De-verbos-ing the api
require('./thorny/base')('./config/default.json', function ($) {
if ($.dooooom().makeHappen() === $('thorny some-dooms-day-feature').makeHappen()) {
// serve cake, because cake and dooooom is an ideal pairing.
}
});
/*global window*/
(function (module) {
module.exports = function ($, module) {
var dooooom = {};
$.onInit(module, function () {
$.registerGlobal('dooooom', function () {
return dooooom;
});
});
/**
* Makes dooooom happen!!!!
* @param void
* @return void
*/
dooooom.makeHappen = function () {
console.log('dooooom!!!!');
};
return dooooom;
};
}((typeof window === 'undefined') ? module : window.thorny_path('./thorny/common/some-dooms-day-feature')));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment