mirror of
https://github.com/streamich/react-use.git
synced 2026-01-25 14:17:16 +00:00
fix: 🐛 allow every promise in usePromise() hook have own type
This commit is contained in:
parent
e330ccb336
commit
d60fef7db3
@ -1,7 +1,7 @@
|
||||
import {useCallback} from 'react';
|
||||
import useRefMounted from './useRefMounted';
|
||||
|
||||
export type UsePromise = <T>() => (promise: Promise<T>) => Promise<T>;
|
||||
export type UsePromise = () => <T>(promise: Promise<T>) => Promise<T>;
|
||||
|
||||
const usePromise: UsePromise = () => {
|
||||
const refMounted = useRefMounted();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user