mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
Merge pull request #144 from streamich/fix-usePromise-typings
fix: 🐛 allow every promise in usePromise() hook have own type
This commit is contained in:
commit
00a3be83d7
@ -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