npm @reduxjs/toolkit 1.3.0-alpha.7
v1.3.0-alpha.7

latest releases: 2.2.3, 2.2.2, 2.2.1...
4 years ago

This release reworks the cancellation functionality in createAsyncThunk.

Changes

createAsyncThunk cancellation

We previously added AbortController support to createAsyncThunk, to allow other code to trigger whatever cancellation might be applicable to the async logic inside.

The thunk now exits early when the abort() method is called and doesn't keep waiting for the payloadCreator to finish. This should be an improvement especially in cases where the payloadCreator didn't care about the abort signal, but something outside was awaiting the promise from dispatch.

Also, before this, a non-signal-aware payloadCreator could still finish which would have caused a dispatch of a "fulfilled" action after an "rejected" (abort) action, which was confusing.

We've also removed the meta.abortReason property as it's no longer possible to override the error in the "rejected" action.

Changelog

v1.3.0-alpha.6...v1.3.0-alpha.7

Don't miss a new toolkit release

NewReleases is sending notifications on new releases.