mirror of
https://github.com/streamich/react-use.git
synced 2026-02-01 14:37:31 +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 {useCallback} from 'react';
|
||||||
import useRefMounted from './useRefMounted';
|
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 usePromise: UsePromise = () => {
|
||||||
const refMounted = useRefMounted();
|
const refMounted = useRefMounted();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user