When creating reducer by createReducer<State, Action> you not get same action type when using handleType and handleAction if your action was created by createAsyncAction.
You get action type: (parameter) action: { type: EActionTypes.FETCH_PROFILE_SUCCESS; payload: {}; } | PayloadAction<EActionTypes.FETCH_PROFILE_SUCCESS, IUser> and because that you get type error.
## Environment (optional)
<!-- Fill if you think it's relevant to your issue -->
- OS: Win10
- Node Version: 12
[1]: https://github.com/piotrwitek/typesafe-actions#compatibility-notes
[2]: https://github.com/piotrwitek/typesafe-actions#migration-guides
Description
When creating reducer by
createReducer<State, Action>
you not get same action type when usinghandleType
andhandleAction
if your action was created bycreateAsyncAction
.Mandatory info
How to Reproduce
Create reducer like so and you get type error:
You get
action
type:(parameter) action: { type: EActionTypes.FETCH_PROFILE_SUCCESS; payload: {}; } | PayloadAction<EActionTypes.FETCH_PROFILE_SUCCESS, IUser>
and because that you get type error.Create reducer like so and everything is ok:
Expected behavior
action
should be type:(parameter) action: PayloadAction<EActionTypes.FETCH_PROFILE_SUCCESS, IUser>
Suggested solution(s)
Project Dependencies
tsconfig.json: