Skip to content

Commit 2b4339f

Browse files
authored
1 change by Nuxt Studio
1 parent fe0a2b6 commit 2b4339f

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

content/features.md

+2-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Features
22

3-
Here's a Markdown file listing all the features and details about the `useNetStack` package:
4-
5-
````markdown
63
# useNetStack - A Powerful Composable for API Requests
74

85
`useNetStack` is a versatile Vue 3/Nuxt 3 composable that abstracts and enhances API requests with built-in features like retries, caching, timeouts, request cancellation, and logging. It is designed to handle common challenges in API requests while providing a flexible and configurable structure.
@@ -32,16 +29,13 @@ executeCall({
3229
retryDelay: 2000, // 2-second delay between retries
3330
});
3431
```
35-
````
3632

3733
### 2. **Timeouts**
3834

3935
Set time limits on API requests to avoid indefinite waiting.
4036

4137
- **Global Default**: 5 seconds
42-
4338
- **Customizable**: Timeout can be set per request
44-
4539
- **Example**:
4640

4741
```ts
@@ -61,11 +55,8 @@ executeCall({
6155
Cache responses for a specified duration to minimize redundant network calls.
6256

6357
- **Global Default**: Cached for 1 minute
64-
6558
- **Customizable**: Set `cacheDuration` per request
66-
6759
- **Skip Cache**: Force bypassing cache by setting `skipCache: true`
68-
6960
- **Example**:
7061

7162
```ts
@@ -87,9 +78,7 @@ executeCall({
8778
Abort ongoing requests using an `AbortController`.
8879

8980
- **Auto-Generated**: Timeout automatically triggers request cancellation
90-
9181
- **Custom**: Pass your own `AbortController` to manually cancel requests
92-
9382
- **Example**:
9483

9584
```ts
@@ -115,7 +104,6 @@ setTimeout(() => controller.abort(), 2000);
115104
Define global defaults for retries, timeouts, caching, and more.
116105

117106
- **Flexible**: Update default settings for all requests
118-
119107
- **Example**:
120108

121109
```ts
@@ -133,9 +121,7 @@ updateGlobalConfig({
133121
Get real-time logging information about request behavior.
134122

135123
- **Global Setting**: Enable or disable logging in the global configuration
136-
137124
- **Log Levels**: `info`, `warn`, `error`
138-
139125
- **Example** log output:
140126

141127
```log
@@ -145,7 +131,6 @@ Get real-time logging information about request behavior.
145131
[WARN]: Retrying... Attempt 2 { endpoint: 'https://api.example.com/data' }
146132
147133
[ERROR]: API call failed { endpoint: 'https://api.example.com/data', error: 'Timeout' }
148-
149134
```
150135

151136
## Methods
@@ -304,7 +289,8 @@ updateGlobalConfig({
304289

305290
The `useNetStack` composable enhances the process of making API requests by providing support for retries, timeouts, caching, cancellation, and logging. It is flexible, with both per-request and global configurations available, making it a powerful tool for handling network requests in your Vue 3/Nuxt 3 applications.
306291

307-
```
292+
```text
308293
309294
This markdown file contains a detailed description of the package and covers all features introduced in `useNetStack`.
295+
310296
```

0 commit comments

Comments
 (0)