Skip to content

Commit

Permalink
return a Kaching output stream even when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Floby committed Mar 15, 2015
1 parent aab6316 commit 47e65f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ function KaChing (cacheDir, options) {
if(typeof provider !== 'function') {
throw new Error('No provider found for resource ' + id);
}
if(disabled) return provider.call(dependerFor(id));

var resultStream = new KaChingOutputStream();
if(disabled) return provider.call(dependerFor(id)).pipe(resultStream);

isCacheAvailable(id, function (available) {
var source = available ? getCachedStream(id) : makeCachedStream(id, provider);
source.pipe(resultStream);
Expand Down

0 comments on commit 47e65f4

Please sign in to comment.