Skip to content

Commit 9e5ed78

Browse files
committed
Add aliases to typings.
1 parent 801564b commit 9e5ed78

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ is set to `"application/json"`.
386386
- `finishedAt` When the last promise was resolved or rejected.
387387
- `status` One of: `waiting`, `pending`, `fulfilled`, `rejected`.
388388
- `isWaiting` true when no promise has ever started, or one started but was cancelled.
389-
- `isPending` true when a promise is currently awaiting settlement.
390-
- `isFulfilled` true when the last promise was fulfilled with a value.
389+
- `isPending` true when a promise is currently awaiting settlement. Alias: `isLoading`
390+
- `isFulfilled` true when the last promise was fulfilled with a value. Alias: `isResolved`
391391
- `isRejected` true when the last promise was rejected with a reason.
392392
- `isSettled` true when the last promise was fulfilled or rejected (not waiting or pending).
393393
- `counter` The number of times a promise was started.

src/index.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ interface AbstractState<T> {
3030
isPending: boolean
3131
isLoading: boolean
3232
isFulfilled: boolean
33+
isResolved: boolean
3334
isRejected: boolean
3435
isSettled: boolean
3536
counter: number
@@ -57,6 +58,14 @@ declare namespace Async {
5758
children?: AsyncChildren<T>
5859
initial?: boolean
5960
}): React.ReactNode
61+
export function Loading<T>(props: {
62+
children?: AsyncChildren<T>
63+
initial?: boolean
64+
}): React.ReactNode
65+
export function Fulfilled<T>(props: {
66+
children?: AsyncChildren<T>
67+
persist?: boolean
68+
}): React.ReactNode
6069
export function Resolved<T>(props: {
6170
children?: AsyncChildren<T>
6271
persist?: boolean
@@ -65,6 +74,10 @@ declare namespace Async {
6574
children?: AsyncChildren<T>
6675
persist?: boolean
6776
}): React.ReactNode
77+
export function Settled<T>(props: {
78+
children?: AsyncChildren<T>
79+
persist?: boolean
80+
}): React.ReactNode
6881
}
6982

7083
declare function createInstance<T>(defaultProps?: AsyncProps<T>): Async<T>

0 commit comments

Comments
 (0)