Skip to content

Commit

Permalink
Require calculate-cache-key-for-tree once
Browse files Browse the repository at this point in the history
  • Loading branch information
2hu12 authored and Longzheng Zhu committed Apr 18, 2019
1 parent a091380 commit 8769d04
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 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,11 +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 {
// make sure results of other treeFor* methods won't get opt-out of cache
// including the "treeForVendor"
return require('calculate-cache-key-for-tree')(treeType, this);
return calculateCacheKeyForTree(treeType, this);
}
},

Expand Down

0 comments on commit 8769d04

Please sign in to comment.