axios-throttled
Creates throttling wrapper above axios
Parameters
config
Object configs object
requestRaw
Return axios query result
Parameters
config
any additional config for query
Examples
const AxiosT = ;; const config = query: 'https://google.com/'; const axiosT = config;await axiosT; // return query result
Returns Promise
request
Return data
key from axios
query result
Parameters
config
any additional config for query
Returns Promise
expandUrl
Fill url sketch with data
Parameters
params
Object placeholders values (optional, default{}
)placemarks
Array.string? array with placemarks
Examples
const AxiosT = ;; const configs = expand1: query: 'https://{host}/{path}' expand2: query: 'https://[[host]]/[[path]]' expand3: query: 'https://[[host]]/[[path]]' placemarks: '[[' ']]' ; // Using default placemarks - `{` & `}`const axiosT1 = configsexpand1;const mail1 = await axiosT1; // Using custom placemarksconst axiosT2 = configsexpand2;const mail2 = await axiosT2; // Using preseted custom placemarksconst axiosT3 = configsexpand3;const mail3 = await axiosT3;
Returns any instance of this class
query
Returns Object
placemarks
Returns Array.string
throttling
getters & setters for axios throttling wrapper (stay, logs) can be used for additional configuration
Examples
const AxiosT = ;; const config = query: 'https://yahoo.com/'; const axiosT = config;await axiosT; // will return query resultaxiosT Date > '3000/01/01' // blocks requests until year 3000await axiosT; // will not invoke any request and return `undefined`