I'm using react and redux in my application. About to add mixpanel to the application now. Mixpanel doesn't need to update any state, I think. So does the mixpanel functions/events need or should be an redux action? Or do you think that would be unnecessary?
My thoughs is that mixpanel will not update any state, therefor it doesn't not need to be in the redux actions.
Whats your input?
Thanks!
Redux is used to maintain the state of your application and helps to interact different components in a better way.
I think putting Mixpanel events in redux state is not required at all.
If you just want to track the views yes it is not required in your redux at all; you can just fire mix panel events on componentDidMount()
.
If you want to track events for maybe social share(like track counts of shares etc..) they you can dispatch actions on button onClick
.
All of the above can be done in your component, so its of no use to bring global state into the picture.