Open xXanth0s opened 3 years ago
I'm not aware of any issues with redux-toolkit
, but on the other hand, we also did not test it with it, so maybe it's the source of problem. In vanilla redux, we cannot see this issue.
I don't think this is necessarily a bug. I believe the issue is that createSlice automatically creates an action for you based on the passed in reducer keys. However, to use triggerAlias middleware, you should be calling createAliasedAction.
So instead of exporting the action created from createSlice, you would need to export an action created from createAliasedAction. It lessens the helpfulness of react toolkit, but it worked in my testing.
In my redux store I recognized, that all actions which are dispatcher, are processed by the main and the renderer store. As far as my store is pretty huge and the data which is processed by some actions needs a bit more calculation power, it is necessary that only the main store is processing these actions. In the documation it is written, that the middleware
triggerAlias
should fix this problem, but actions are still processed in all stores. Also creating an alias action and dispatching that is not fixing the problemI am using redux-toolkit to create the store. Is there any common issue known with that framework?
Here is my code to create stores
Example for reducer