v6.0.0: Status prop to match Promise specification
This major release introduces a new status
prop which closely follows the terminology in the Promise specification. The Pending
helper component was renamed to Initial
accordingly, causing a breaking change. The new status
prop comes with separate TypeScript types for each state, allowing us to make many optional properties required. This should improve usability in a TypeScript codebase.
- Breaking change:
Async.Pending
was renamed toAsync.Initial
- Added the
status
prop, which can be one ofinitial
,pending
,fulfilled
orrejected
- Added
isInitial
,isPending
,isFulfilled
(with aliasisResolved
),isRejected
andisSettled
boolean props.isLoading
is now an alias forisPending
. - Added separate TypeScript types for each status, to make various props non-optional.
Required upgrade steps:
- Rename all instances of
<Async.Pending>
to<Async.Initial>
. Don't forget to deal with custom instances of<Async>
.
Optional upgrade steps (these are now aliases):
- Rename
isLoading
toisPending
. - Rename
<Async.Loading>
to<Async.Pending>
. - Rename
<Async.Resolved>
to<Async.Fulfilled>
.