Open OliverJAsh opened 1 year ago
Thanks for the issue!
Seems worth fixing, but I'm not sure making EnhancerOptions
, composeWithDevTools
, and devToolsEnhancer
generic would be the right solution since there's no way to guarantee that a certain enhancer receives a certain state/action at the type or runtime level.
I think the right fix would be to make the state types unknown
and the action types Action<string>
. The user can then cast those if they know the enhancer will only receive their state/action types.
there's no way to guarantee that a certain enhancer receives a certain state/action at the type
Could we change the Redux types to pass the state and action generics through to StoreEnhancer
e.g. from StoreCreator
? This would be a bigger change of course, but I think that would make most sense when type safety is the goal.
Maybe?
That makes sense to me. Unfortunately I don't have the time to pick this up right now, as much as I would love to. Thanks for your input and sharing your thoughts.
Something fancier would be cool, but the simple unknown
solution would be way better than what we have now
Reduced test case:
I raised a PR to fix this in the old repository: https://github.com/zalmoxisus/redux-devtools-extension/pull/716. If this looks good, I'd be happy raise another PR.