retrofit-axios-ts
Version:
A declarative and axios based retrofit implementation for JavaScript and TypeScript.
18 lines (17 loc) • 529 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Timeout = void 0;
const ensureMeta_1 = require("../helpers/ensureMeta");
/**
* Set timeout for method, this config will shield service timeout.
* @param timeout
* @sample @Timeout(5000)
* @constructor
*/
const Timeout = (timeout) => {
return (target, methodName) => {
(0, ensureMeta_1.ensureMeta)(target, methodName);
target.__meta__[methodName].timeout = timeout;
};
};
exports.Timeout = Timeout;