Merge pull request #144 from streamich/fix-usePromise-typings

fix: 🐛 allow every promise in usePromise() hook have own type
This commit is contained in:
Va Da 2019-03-15 15:46:18 +01:00 committed by GitHub
commit 00a3be83d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();