Skip to content

Commit d721489

Browse files
committed
πŸ“ Update README
1 parent 3066c6e commit d721489

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

β€ŽREADME.md

+19-4
Original file line numberDiff line numberDiff line change
@@ -1063,11 +1063,26 @@ try {
10631063
}
10641064
```
10651065

1066-
### Removed exports
1066+
### Removed `options` from the second argument of `onResponse`, `onSuccess`, and `onFailure`
10671067

1068-
- `isResponseError`
1069-
- `isTimeoutError`
1070-
- `isAbortError`
1068+
```diff
1069+
const api = YF.create({
1070+
- async onFailure(error, options) {
1071+
- console.log(options.headers)
1072+
- },
1073+
+ async onFailure(error) {
1074+
+ if (error instanceof YF.ResponseError) {
1075+
+ console.log(error.response.options.headers)
1076+
+ }
1077+
+ },
1078+
})
1079+
```
1080+
1081+
### Removed helpers
1082+
1083+
- `isResponseError` β†’ `error instanceof YF.ResponseError`
1084+
- `isTimeoutError` β†’ `error instanceof YF.TimeoutError`
1085+
- `isAbortError` β†’ `error instanceof Error && error.name === 'AbortError'`
10711086

10721087
## πŸ”— Alternatives
10731088

0 commit comments

Comments
Β (0)