Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
callBase: function() {
let d = new def.Deferred();
d.resolve('test', 'success');
return d.promise();
}
};
let key = makeStateKey(that.generateKey(args)),
cachedData = that.state.get(key, null as any);
if (isPlatformServer(that.platformId)) {
let result = this.callBase.apply(this, args);
result.always((data, status) => {
let dataForCache = {
data: data,
status: status
};
that.state.set(key, dataForCache as any);
});
return result;
} else {
if (cachedData) {
let d = new deferred.Deferred();
d.resolve(cachedData.data, cachedData.status);
that.state.set(key, null as any);
return d.promise();
}
return this.callBase.apply(this, args);
}
}
});