retrofit-axios-ts
Version:
A declarative and axios based retrofit implementation for JavaScript and TypeScript.
18 lines (17 loc) • 530 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Config = void 0;
const ensureMeta_1 = require("../helpers/ensureMeta");
/**
* A direct way to set config for a request in axios.
* @param config
* @sample @Config({ maxRedirects: 1 })
* @constructor
*/
const Config = (config) => {
return (target, methodName, another) => {
(0, ensureMeta_1.ensureMeta)(target, methodName);
target.__meta__[methodName].config = config;
};
};
exports.Config = Config;