Skip to content

Commit f5831b8

Browse files
authored
Update README.md
1 parent 6bbbae2 commit f5831b8

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ const {
142142
post,
143143
patch,
144144
put,
145-
del,
146-
// delete
145+
delete // don't destructure `delete` though, it's a keyword
146+
del, // <- that's why we have this (del). or use `request.delete`
147147
} = useFetch({
148148
url: 'https://example.com',
149149
baseUrl: 'https://example.com',
@@ -158,9 +158,14 @@ const [data, loading, error, request] = useFetch({
158158
onMount: true
159159
})
160160

161-
// 1 caveat, only use `request.delete`, don't destructure like below
162-
// that's what `del` is for since `delete` is a key word
163-
const { get, post, patch, put, del, delete } = request
161+
const {
162+
get,
163+
post,
164+
patch,
165+
put,
166+
delete // don't destructure `delete` though, it's a keyword
167+
del, // <- that's why we have this (del). or use `request.delete`
168+
} = request
164169
```
165170
166171
Credits

0 commit comments

Comments
 (0)