@@ -38,13 +38,10 @@ export interface FetchOptions<T> extends AsyncOptions<T> {
38
38
json ?: boolean
39
39
}
40
40
41
- function useAsync < T extends { } > ( options : AsyncOptions < T > ) : AsyncState < T >
42
- function useAsync < T extends { } > ( promiseFn : PromiseFn < T > , options ?: AsyncOptions < T > ) : AsyncState < T >
41
+ function useAsync < T > ( options : AsyncOptions < T > ) : AsyncState < T >
42
+ function useAsync < T > ( promiseFn : PromiseFn < T > , options ?: AsyncOptions < T > ) : AsyncState < T >
43
43
44
- function useAsync < T extends { } > (
45
- arg1 : AsyncOptions < T > | PromiseFn < T > ,
46
- arg2 ?: AsyncOptions < T >
47
- ) : AsyncState < T > {
44
+ function useAsync < T > ( arg1 : AsyncOptions < T > | PromiseFn < T > , arg2 ?: AsyncOptions < T > ) : AsyncState < T > {
48
45
const options : AsyncOptions < T > =
49
46
typeof arg1 === "function"
50
47
? {
@@ -285,11 +282,11 @@ function isEvent(e: FetchRunArgs[0]): e is Event | React.SyntheticEvent {
285
282
* @param {FetchOptions } options
286
283
* @returns {AsyncState<T, FetchRun<T>> }
287
284
*/
288
- const useAsyncFetch = < T extends { } > (
285
+ function useAsyncFetch < T > (
289
286
resource : RequestInfo ,
290
287
init : RequestInit ,
291
288
{ defer, json, ...options } : FetchOptions < T > = { }
292
- ) : AsyncState < T , FetchRun < T > > => {
289
+ ) : AsyncState < T , FetchRun < T > > {
293
290
const method = ( resource as Request ) . method || ( init && init . method )
294
291
const headers : Headers & Record < string , any > =
295
292
( resource as Request ) . headers || ( init && init . headers ) || { }
0 commit comments