mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-08-09 02:24:25 +00:00
Refactor: Stats card: Use typedef tags inside data fetcher (#3056)
This commit is contained in:
@@ -6,11 +6,16 @@ const PATs = Object.keys(process.env).filter((key) =>
|
||||
).length;
|
||||
const RETRIES = PATs ? PATs : 7;
|
||||
|
||||
/**
|
||||
* @typedef {import("axios").AxiosResponse} AxiosResponse Axios response.
|
||||
* @typedef {(variables: object, token: string) => Promise<AxiosResponse>} FetcherFunction Fetcher function.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Try to execute the fetcher function until it succeeds or the max number of retries is reached.
|
||||
*
|
||||
* @param {object[]} fetcher The fetcher function.
|
||||
* @param {object[]} variables Object with arguments to pass to the fetcher function.
|
||||
* @param {FetcherFunction} fetcher The fetcher function.
|
||||
* @param {object} variables Object with arguments to pass to the fetcher function.
|
||||
* @param {number} retries How many times to retry.
|
||||
* @returns {Promise<T>} The response from the fetcher function.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user