coolsoftwaretyler / mst-middlewares

Prebuilt middlewares for MobX-State-Tree
5 stars 2 forks source link

Problems when logging actions that receive non-serializable params #19

Open rafaelrollup opened 10 months ago

rafaelrollup commented 10 months ago

In MST, we're able to store non-serializable objects in volatile fields. When using connectReduxDevtools, if we create an action to set such field, an error will be thrown because somewhere in code it tries to log the action arguments. For now I've simply disabled logArgsNearMe, but it would be nice to have this logging functionality for other actions whose args are indeed serializable.

Maybe we can do some sort of check? If it's serializable, then log it, if not simply skip it.

coolsoftwaretyler commented 10 months ago

Hey @rafaelrollup - thanks for submitting the issue.

Are you interested in submitting a PR to this effect? If so, I'd be happy to review and merge when you get to it.

If you're not interested in that, would you mind writing a reproducible example so other folks can be clear about the problem?

Thanks either way!