'use strict'; /** *+------------------------------------------------------------------------+ *| Licensed Materials - Property of IBM *| IBM Cognos Products: Dashboard *| (C) Copyright IBM Corp. 2018 *| *| US Government Users Restricted Rights - Use, duplication or disclosure *| restricted by GSA ADP Schedule Contract with IBM Corp. *+------------------------------------------------------------------------+ */ define(['underscore', './VIPRDataRequestHandler'], function (_, VIPRHandler) { var VIPRCachedHandler = VIPRHandler.extend({ init: function init(options) { VIPRCachedHandler.inherited('init', this, arguments); this.handler = options.handler; }, // Implement IDataRequestHandler request: function request(_request) { if (!this.handler) { return VIPRCachedHandler.inherited('request', this, arguments); } var data = this.handler.getLastRequestData(_request.name); if (data) { var dataCopy = _.clone(data); this._requestComplete(_request, dataCopy); } else { return VIPRCachedHandler.inherited('request', this, arguments); } }, _requestComplete: function _requestComplete(_request, data) { var shouldCache = false; return VIPRCachedHandler.inherited('_requestComplete', this, [_request, data, shouldCache]); }, _requestFail: function _requestFail(_request, data) { var shouldCache = false; return VIPRCachedHandler.inherited('_requestFail', this, [_request, data, shouldCache]); }, _invokeCallback: function _invokeCallback() /* name, data */{} }); return VIPRCachedHandler; }); //# sourceMappingURL=VIPRCachedDataRequestHandler.js.map