Is it possible to make usePromise strongly typed?
Currently it's
function usePromise (
promise: (...inputs: any) => any,
inputs: Array<any>,
lifespan: number = 0
): any
Perhaps a strongly typed flavor could be provided, such as
function usePromise<T, A>(
promise: (A) => Promise<T>,
inputs: A,
lifespan: number = 0
): T
This might require some type coercion under the hood because the global singleton const promiseCaches: PromiseCache[] can't use type T above.
Is it possible to make
usePromisestrongly 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 typeTabove.