v5.0.0
Breaking changes
isFinishedFetching()
,isSyncingWithRemote()
,isSyncedWithRemote()
,isSyncedSuccessfully()
,isInErrorState()
have been removed in favour of a more consistently named helpers. See Data lifecyles for more information.
Bugfixes (possibly breaking changes)
-
Changed
getOrFetch()
to dispatch its first action asynchronously. This addresses React warnings when multiple mounted components in the same render cycle calledgetOrFetch()
, triggering an update to the state of a parent component. -
getOrFetchList()
now returns lists with a status ofFETCHING
immediately (rather than one with an undefined status) -
Fixed empty JSON responses causing a client-side parsing error.
New features
- In addition to action creators,
resources
andresource
now export dispatchers - Added a new
saveItem()
function for creating or updating a resource item based what state its currently in. - Added a
getOrInitializeItem()
function for automatically instantiating new resources not in the store. getOrFetchItem()
andgetOrFetchList()
can now be used with alocalOnly
resource, to maintain a more consistent interface when interacting with local resources and remote ones- Fixed TypeScript argument types for the
buildInitialStatus()
function for singular resources - Fix argument processing for defining
localOnly
actions - Added a new
isNewItemkey()
function for evaluating a value matches the one being used as the key for the newest item. - Added a new
getHttpStatusCode()
function for returning the HTTP status code of the last request performed on an item or list.