@@ -38,13 +38,10 @@ export interface FetchOptions<T> extends AsyncOptions<T> {
3838 json ?: boolean
3939}
4040
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 >
4343
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 > {
4845 const options : AsyncOptions < T > =
4946 typeof arg1 === "function"
5047 ? {
@@ -285,11 +282,11 @@ function isEvent(e: FetchRunArgs[0]): e is Event | React.SyntheticEvent {
285282 * @param {FetchOptions } options
286283 * @returns {AsyncState<T, FetchRun<T>> }
287284 */
288- const useAsyncFetch = < T extends { } > (
285+ function useAsyncFetch < T > (
289286 resource : RequestInfo ,
290287 init : RequestInit ,
291288 { defer, json, ...options } : FetchOptions < T > = { }
292- ) : AsyncState < T , FetchRun < T > > => {
289+ ) : AsyncState < T , FetchRun < T > > {
293290 const method = ( resource as Request ) . method || ( init && init . method )
294291 const headers : Headers & Record < string , any > =
295292 ( resource as Request ) . headers || ( init && init . headers ) || { }
0 commit comments