From 8536ca67bf1f905f7a804e13b09ac14519652d98 Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Wed, 24 Dec 2025 07:22:58 -0600 Subject: [PATCH] Add some TS Docs around axios configuration update README --- README.md | 3 ++- src/configs/axios.config.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f93d9e81..314c6b11 100644 --- a/README.md +++ b/README.md @@ -231,7 +231,6 @@ Install via [Altstore](https://altstore.io) or your favorite sideloading utility [React Native Blurhash](https://github.com/mrousavy/react-native-blurhash)\ [React Native CarPlay](https://github.com/birkir/react-native-carplay)\ [React Native Sortables](https://github.com/MatiPl01/react-native-sortables)\ -[React Native Nitro Modules](https://github.com/mrousavy/react-native-nitro-modules)\ [React Native Reanimated](https://docs.swmansion.com/react-native-reanimated/)\ [React Native Toast Message](https://github.com/calintamas/react-native-toast-message)\ [React Native Vector Icons](https://github.com/oblador/react-native-vector-icons) @@ -246,6 +245,8 @@ Install via [Altstore](https://altstore.io) or your favorite sideloading utility [React Native File Access](https://github.com/alpha0010/react-native-file-access)\ [React Native Google Cast](https://github.com/react-native-google-cast/react-native-google-cast)\ [React Native MMKV](https://github.com/mrousavy/react-native-mmkv)\ +[React Native Nitro Fetch](https://github.com/margelo/react-native-nitro-fetch)\ +[React Native Nitro Modules](https://github.com/mrousavy/react-native-nitro-modules)\ [React Native Nitro OTA](https://github.com/riteshshukla04/react-native-nitro-ota)\ [React Native Track Player](https://github.com/doublesymmetry/react-native-track-player)\ [React Native URL Polyfill](https://github.com/charpeni/react-native-url-polyfill)\ diff --git a/src/configs/axios.config.ts b/src/configs/axios.config.ts index 7268ff1c..e3a9babb 100644 --- a/src/configs/axios.config.ts +++ b/src/configs/axios.config.ts @@ -1,6 +1,14 @@ import axios, { AxiosAdapter } from 'axios' import { fetch } from 'react-native-nitro-fetch' +/** + * Custom Axios adapter using {@link fetch} from `react-native-nitro-fetch`. + * + * This will handle HTTP requests made through Axios by leveraging the Nitro Fetch API. + * + * @param config the Axios request config + * @returns + */ const nitroAxiosAdapter: AxiosAdapter = async (config) => { const response = await fetch(config.url!, { method: config.method?.toUpperCase(), @@ -30,6 +38,8 @@ const nitroAxiosAdapter: AxiosAdapter = async (config) => { /** * The Axios instance for making HTTP requests. * + * Leverages the {@link nitroAxiosAdapter} for handling requests. + * * Default timeout is set to 60 seconds. */ const AXIOS_INSTANCE = axios.create({