Skip to content

Commit bb58591

Browse files
committed
docs: add getDefaultConfig function to README and export it
1 parent 3c78d53 commit bb58591

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,24 @@ const { data, error } = await fetchf('/api/user-details', {
140140

141141
### Global Configuration
142142

143+
#### `getDefaultConfig()`
144+
145+
<details>
146+
<summary><span style="cursor:pointer">Click to expand</span></summary>
147+
<br>
148+
149+
Returns the current global default configuration used for all requests. This is useful for inspecting or debugging the effective global settings.
150+
151+
```typescript
152+
import { getDefaultConfig } from 'fetchff';
153+
154+
// Retrieve the current global default config
155+
const config = getDefaultConfig();
156+
console.log('Current global fetchff config:', config);
157+
```
158+
159+
</details>
160+
143161
#### `setDefaultConfig(customConfig)`
144162

145163
<details>

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export { createApiFetcher } from './api-handler';
1111
export {
1212
buildConfig, // Build request configuration from defaults and overrides
1313
setDefaultConfig, // Set global default configuration for requests
14+
getDefaultConfig, // Get the current global default configuration
1415
} from './config-handler';
1516

1617
/** Cache management utilities */

0 commit comments

Comments
 (0)