Skip to content

Instantly share code, notes, and snippets.

@v0lkan
Created January 31, 2014 04:52
Show Gist options
  • Save v0lkan/8726790 to your computer and use it in GitHub Desktop.
Save v0lkan/8726790 to your computer and use it in GitHub Desktop.
// This...
exports.find = function(queue, query, callback) {
switch(queue) {
case 'today':
return callback(null, {
query: query,
realm: 'today',
goals: privates.getTodayGoals(query)
});
case 'tomorrow':
return callback(null, {
query: query,
realm: 'tomorrow',
goals: privates.getTomorrowGoals(query)
});
default:
return callback(null, {
query: query,
realm: 'today',
goals: privates.getTodayGoals(query)
});
}
};
// Became this:
exports.find = function(queue, query, callback) {
(privates.findThunk[queue] || privates.getDefaultFindThunk())(callback, query);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment