File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,22 @@ patch({
9393})
9494```
9595
96+ #### Coming Soon: ` abort `
97+
98+ ``` jsx
99+ const { data , loading , request } = useFetch ({
100+ baseUrl: ` https://api.github.com/search`
101+ })
102+
103+ const searchGithub = e => request .get (` /repositories?q=${ e .target .value || " ''" } ` )
104+
105+ <>
106+ < input onChange= {searchGithub} / >
107+ < button onClick= {request .abort ()}> Abort< / button>
108+ {loading ? ' Loading...' : < code>< pre> {data}< / pre>< / code> }
109+ < / >
110+ ```
111+
96112Hooks
97113----
98114| Option | Description |
@@ -144,5 +160,4 @@ Todos
144160 - [ ] Allow option to fetch on server instead of just having ` loading ` state
145161 - [ ] Allow option for callback for response.json() vs response.text()
146162 - [ ] add ` timeout `
147- - [ ] if 2nd param of ` post ` or one of the methods is a ` string ` treat it as query params
148163 - [ ] error handling if no url is passed
You can’t perform that action at this time.
0 commit comments