Created
October 4, 2011 10:50
-
-
Save iaincarsberg/1261339 to your computer and use it in GitHub Desktop.
RequireJS - Compose.js together
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global require*/ | |
require(['whom'], function (Whom) { | |
var me = new Whom('Iain', 27); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global define*/ | |
define( | |
[ | |
'compose' | |
], | |
function ( | |
Compose | |
) { | |
return Compose( | |
function (name, age) { | |
this.name = name; | |
this.age = age; | |
}, | |
{ | |
/** | |
* Used to expose the x coordinate | |
* @param void | |
* @return double Containing the x value | |
*/ | |
whom: function () { | |
return [ | |
this.name, | |
'is', | |
this.age, | |
'years of age.' | |
].join(' '); | |
} | |
} | |
); | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment