reduxjs/redux-toolkit
### [`v1.3.6`](https://togithub.com/reduxjs/redux-toolkit/releases/v1.3.6)
[Compare Source](https://togithub.com/reduxjs/redux-toolkit/compare/v1.3.5...v1.3.6)
This release fixes a couple edge cases with Immer usage and reducers, and exposes the `typePrefix` field from thunks generated by `createAsyncThunk`.
#### Changes
##### Immer Reducer Fixes
The `createEntityAdapter` CRUD methods can be used as either standalone reducers (in which case they call `createNextState()` internally) or "mutating" helper functions if given an existing Immer `Draft` value. However, `createReducer` always assumed you were using the reducer standalone.
If you were trying to wrap `createReducer` and pass in a `Draft` value, changes inside wouldn't be reflected in the external `Draft`. We've updated `createReducer` to check if the incoming state value is actually a \`Draft.
Also, the `removeAll` CRUD method from `createEntityAdapter` wasn't working correctly when used as a mutating helper, for similar reasons. We've tweaked the logic there to work right.
##### Thunk Type Prefix
`createAsyncThunk` accepts a `typePrefix` string as its first argument, and uses that to generate the `pending/fulfilled/rejected` action types it dispatches. We had some requests to expose that type string for later usage, so the thunk function now has a `thunk.typePrefix` field containing that string.
#### Changelog
- expose createAsyncThunk typePrefix parameter on the actionCreator ([@phryneas](https://togithub.com/phryneas) - [#546](https://togithub.com/reduxjs/redux-toolkit/issues/546))
- Allow nested Immer produce statements with createReducer ([@AndrewCraswell](https://togithub.com/AndrewCraswell) - [#509](https://togithub.com/reduxjs/redux-toolkit/issues/509))
- fix [#541](https://togithub.com/reduxjs/redux-toolkit/issues/541): invoke removeAll mutably within produce ([@phryneas](https://togithub.com/phryneas) - [#544](https://togithub.com/reduxjs/redux-toolkit/issues/544))
Renovate configuration
:date: Schedule: At any time (no schedule defined).
:vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.
:recycle: Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
:no_bell: Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
1.3.5
->1.3.6
Release Notes
reduxjs/redux-toolkit
### [`v1.3.6`](https://togithub.com/reduxjs/redux-toolkit/releases/v1.3.6) [Compare Source](https://togithub.com/reduxjs/redux-toolkit/compare/v1.3.5...v1.3.6) This release fixes a couple edge cases with Immer usage and reducers, and exposes the `typePrefix` field from thunks generated by `createAsyncThunk`. #### Changes ##### Immer Reducer Fixes The `createEntityAdapter` CRUD methods can be used as either standalone reducers (in which case they call `createNextState()` internally) or "mutating" helper functions if given an existing Immer `Draft` value. However, `createReducer` always assumed you were using the reducer standalone. If you were trying to wrap `createReducer` and pass in a `Draft` value, changes inside wouldn't be reflected in the external `Draft`. We've updated `createReducer` to check if the incoming state value is actually a \`Draft. Also, the `removeAll` CRUD method from `createEntityAdapter` wasn't working correctly when used as a mutating helper, for similar reasons. We've tweaked the logic there to work right. ##### Thunk Type Prefix `createAsyncThunk` accepts a `typePrefix` string as its first argument, and uses that to generate the `pending/fulfilled/rejected` action types it dispatches. We had some requests to expose that type string for later usage, so the thunk function now has a `thunk.typePrefix` field containing that string. #### Changelog - expose createAsyncThunk typePrefix parameter on the actionCreator ([@phryneas](https://togithub.com/phryneas) - [#546](https://togithub.com/reduxjs/redux-toolkit/issues/546)) - Allow nested Immer produce statements with createReducer ([@AndrewCraswell](https://togithub.com/AndrewCraswell) - [#509](https://togithub.com/reduxjs/redux-toolkit/issues/509)) - fix [#541](https://togithub.com/reduxjs/redux-toolkit/issues/541): invoke removeAll mutably within produce ([@phryneas](https://togithub.com/phryneas) - [#544](https://togithub.com/reduxjs/redux-toolkit/issues/544))Renovate configuration
:date: Schedule: At any time (no schedule defined).
:vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.
:recycle: Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
:no_bell: Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.