Skip to content

Instantly share code, notes, and snippets.

@bendrucker
Created September 27, 2014 16:35
Show Gist options
  • Select an option

  • Save bendrucker/9e175261444492c69c46 to your computer and use it in GitHub Desktop.

Select an option

Save bendrucker/9e175261444492c69c46 to your computer and use it in GitHub Desktop.
Over-organization of code is no good
var messages = require('./src');
// do this
module.exports = messages.extract()
.tap(function (messages) {
console.log('Retrieved %d messages', messages.length);
})
.then(messages.transform)
.done(messages.load);
// this is silly
function logLength (messages) {
console.log('Retrieved %d messages', messages.length);
}
module.exports = messages.extract()
.tap(logLength)
.then(messages.transform)
.done(messages.load);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment