@readr-media/react-election-widgets
Version:
22 lines (16 loc) • 603 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _axios = _interopRequireDefault(require("axios"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const apiClient = _axios.default.create(); //NOTE: Add an interceptor to attach a cache-busting param to all requests when isRunning is true
apiClient.interceptors.request.use(config => {
config.params = { ...config.params,
v: Math.floor(Date.now() / 100)
};
return config;
});
var _default = apiClient;
exports.default = _default;