From b0c97709bfe2c87d32ecc1f81286c374a8877c63 Mon Sep 17 00:00:00 2001 From: ZHAO Jinxiang Date: Fri, 29 Mar 2019 15:10:12 +0800 Subject: [PATCH] fix: add optional attributes in AsyncState --- src/useAsync.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/useAsync.ts b/src/useAsync.ts index 509f9991..c648c691 100644 --- a/src/useAsync.ts +++ b/src/useAsync.ts @@ -3,10 +3,13 @@ import { useState, useEffect, useCallback, DependencyList } from 'react'; export type AsyncState = | { loading: true; + error?: undefined; + value?: undefined; } | { loading: false; error: Error; + value?: undefined; } | { loading: false;