Merge pull request #191 from xiaoxiangmoe/master

fix: add optional attributes in AsyncState
This commit is contained in:
Va Da 2019-03-29 09:05:24 +01:00 committed by GitHub
commit 2bde034876
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,10 +3,13 @@ import { useState, useEffect, useCallback, DependencyList } from 'react';
export type AsyncState<T> =
| {
loading: true;
error?: undefined;
value?: undefined;
}
| {
loading: false;
error: Error;
value?: undefined;
}
| {
loading: false;