UNPKG

create-fetch-hooks

Version:

A simple and powerful custom React hook (useApi) that simplifies API requests with automatic loading and error states. Ideal for clean and maintainable data fetching in React components.

6 lines (5 loc) 285 B
import { post } from "./post"; export const refreshToken = async (baseApiUrl, url, body, setAccessTokenFn) => { console.log("Calling refresh token..."); setAccessTokenFn === null || setAccessTokenFn === void 0 ? void 0 : setAccessTokenFn(await post(baseApiUrl, url, body)); };