Skip to content

Commit

Permalink
Use fetch options, if provided.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Dean committed Oct 25, 2012
1 parent f8d4f34 commit 84ebf1d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions index.js
Expand Up @@ -227,8 +227,16 @@ function Tubbs(fn, options) {
},

fetch: {
value: function(cb) {
dataStore.fetch(function(e) {
value: function(options, cb) {

if (options && Object.prototype.toString.call(options) == '[object Function]') {
// `options` is a function, which means it's actually the callback
// and no options were provided.
cb = options;
options = {};
}

dataStore.fetch(options, function(e) {
if (cb) cb(e);
if (!e) fn.emit('fetch');
});
Expand Down

0 comments on commit 84ebf1d

Please sign in to comment.