We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f19669 commit bad91e3Copy full SHA for bad91e3
lib/client_v2.js
@@ -62,14 +62,7 @@ export default class ClientV2 extends Client {
62
delete obj.cachable
63
var cacheName = tools.unqiue(obj)
64
65
- if (cached) {
66
- var currently = tools.cache(cacheName)
67
- if (currently !== undefined) return Promise.resolve(currently)
68
- }
69
-
70
- return Client.prototype.request.call(this, obj).then((data) => {
71
- if (cached) tools.cache(cacheName, data)
72
- return data
73
- })
+ if (cached) return tools.cache(cacheName) || tools.cache(cacheName, super.request(obj))
+ else return super.request(obj)
74
}
75
0 commit comments