Skip to content

Commit 297a1e5

Browse files
committed
Update dependencies, fixing flow error
1 parent 03fa45a commit 297a1e5

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
"babel": "5.8.21",
4343
"babel-runtime": "^5.8.x",
4444
"babel-core": "5.8.22",
45-
"babel-eslint": "4.0.10",
46-
"chai": "3.2.0",
47-
"coveralls": "2.11.3",
48-
"eslint": "1.1.0",
49-
"eslint-plugin-babel": "^2.1.1",
50-
"flow-bin": "0.14.0",
45+
"babel-eslint": "4.1.6",
46+
"chai": "3.4.1",
47+
"coveralls": "2.11.6",
48+
"eslint": "1.10.3",
49+
"eslint-plugin-babel": "2.2.0",
50+
"flow-bin": "0.20.1",
5151
"isparta": "3.0.3",
52-
"mocha": "2.2.5",
53-
"sane": "1.1.3"
52+
"mocha": "2.3.4",
53+
"sane": "1.3.0"
5454
}
5555
}

src/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ export default class DataLoader<K, V> {
6565
var shouldCache = !options || options.cache !== false;
6666

6767
// If caching and there is a cache-hit, return cached Promise.
68-
if (shouldCache && this._promiseCache.has(key)) {
69-
return this._promiseCache.get(key);
68+
if (shouldCache) {
69+
var cachedPromise = this._promiseCache.get(key);
70+
if (cachedPromise) {
71+
return cachedPromise;
72+
}
7073
}
7174

7275
// Otherwise, produce a new Promise for this value.

0 commit comments

Comments
 (0)