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
# Adding context for req/res cycle for Express.js. | |
# With context it would be possible to write more terse code: | |
# | |
# app.use -> | |
# @user = {name: 'Anonymous'} | |
# @next() | |
# | |
# app.get '/', -> | |
# @res.end "Hello, #{@user.name}" | |
# |
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
// Example: | |
JavaScript.load("/javascripts/something.js"); | |
// With callback (that’s the good thing): | |
JavaScript.load("http://www.someawesomedomain.com/api.js", function() { | |
API.use(); // or whatever api.js provides ... | |
}); |