Skip to content

Commit

Permalink
Refactor: Repo card: Use typedef tags inside data fetcher to resolve …
Browse files Browse the repository at this point in the history
…eslint errors (anuraghazra#3043)
  • Loading branch information
qwerty541 authored Aug 5, 2023
1 parent 036f80f commit 3b975d0
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/fetchers/repo-fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
import { retryer } from "../common/retryer.js";
import { MissingParamError, request } from "../common/utils.js";

/**
* @typedef {import('axios').AxiosRequestHeaders} AxiosRequestHeaders Axios request headers.
* @typedef {import('axios').AxiosResponse} AxiosResponse Axios response.
*/

/**
* Repo data fetcher.
*
* @param {import('axios').AxiosRequestHeaders} variables Fetcher variables.
* @param {AxiosRequestHeaders} variables Fetcher variables.
* @param {string} token GitHub token.
* @returns {Promise<import('axios').AxiosResponse>} The response.
* @returns {Promise<AxiosResponse>} The response.
*/
const fetcher = (variables, token) => {
return request(
Expand Down Expand Up @@ -53,12 +58,16 @@ const fetcher = (variables, token) => {

const urlExample = "/api/pin?username=USERNAME&amp;repo=REPO_NAME";

/**
* @typedef {import("./types").RepositoryData} RepositoryData Repository data.
*/

/**
* Fetch repository data.
*
* @param {string} username GitHub username.
* @param {string} reponame GitHub repository name.
* @returns {Promise<import("./types").RepositoryData>} Repository data.
* @returns {Promise<RepositoryData>} Repository data.
*/
const fetchRepo = async (username, reponame) => {
if (!username && !reponame) {
Expand Down

0 comments on commit 3b975d0

Please sign in to comment.