You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to have this typed feature, because the current usePromise cannot catch type error like this:
function getApple(id: string): Promise<Apple> {...}
function useOrange(id: string): Orange {
return usePromise(getApple, [id]) // <-- It returns `any`, so type error cannot be caught
}
Is it possible to make
usePromise
strongly typed?Currently it's
Perhaps a strongly typed flavor could be provided, such as
This might require some type coercion under the hood because the global singleton
const promiseCaches: PromiseCache[]
can't use typeT
above.The text was updated successfully, but these errors were encountered: