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.Pendingwas renamed toAsync.Initial - Added the
statusprop, which can be one ofinitial,pending,fulfilledorrejected - Added
isInitial,isPending,isFulfilled(with aliasisResolved),isRejectedandisSettledboolean props.isLoadingis 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
isLoadingtoisPending. - Rename
<Async.Loading>to<Async.Pending>. - Rename
<Async.Resolved>to<Async.Fulfilled>.