You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be great to have a guard for passing in an action creator that doesn't have a truthy type string value.
I encountered this issue when migrating over to RTK. We built some custom action creators that we use in combination with a custom api middleware (we're not ready to switch to RTQ just yet - baby steps 😅!). While these have the toString() override, the builder addCase method is not using that and it seems like this override is getting deprecated in v2.
The following led to a fairly subtle bug, since it fails silently.
Since I'm working in JS, this issue is easier to run into. Although, I believe a guard may still be helpful to prevent accidental assignments of an empty string to the type attribute in the implementation of a custom action creator in TS.
It'd be great to have a guard for passing in an action creator that doesn't have a truthy
type
string value.I encountered this issue when migrating over to RTK. We built some custom action creators that we use in combination with a custom api middleware (we're not ready to switch to RTQ just yet - baby steps 😅!). While these have the
toString()
override, the builderaddCase
method is not using that and it seems like this override is getting deprecated in v2.The following led to a fairly subtle bug, since it fails silently.
Since I'm working in JS, this issue is easier to run into. Although, I believe a guard may still be helpful to prevent accidental assignments of an empty string to the
type
attribute in the implementation of a custom action creator in TS.redux-toolkit/packages/toolkit/src/mapBuilders.ts
Lines 158 to 168 in 24fc343
The text was updated successfully, but these errors were encountered: