Skip to content

Commit

Permalink
Merge pull request #279 from 2hu12/patch-1
Browse files Browse the repository at this point in the history
Update cacheKeyForTree to cache the treeForVendor
  • Loading branch information
xg-wang authored Apr 18, 2019
2 parents 2bb4258 + 8769d04 commit 5a6c1e5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const concat = require('broccoli-concat');
const map = stew.map;
const Rollup = require('broccoli-rollup');
const BroccoliDebug = require('broccoli-debug');
const calculateCacheKeyForTree = require('calculate-cache-key-for-tree');

const debug = BroccoliDebug.buildDebugCallback('ember-fetch');

Expand Down Expand Up @@ -135,9 +136,11 @@ module.exports = {

cacheKeyForTree(treeType) {
if (treeType === 'public') {
return require('calculate-cache-key-for-tree')('public', this, [!this.parent.parent]);
return calculateCacheKeyForTree('public', this, [!this.parent.parent]);
} else {
return this._super.cacheKeyForTree.call(this, treeType);
// make sure results of other treeFor* methods won't get opt-out of cache
// including the "treeForVendor"
return calculateCacheKeyForTree(treeType, this);
}
},

Expand Down

0 comments on commit 5a6c1e5

Please sign in to comment.