aohua/redux-state-sync

Feature Request: modify actions

rowrowrowrow opened this issue · 4 comments

Hi, thanks for the great package!

Would you consider adding a function to the configuration for modifying the actions before they are sent?

aohua commented

Yea, sure, but could you provide a use case?

Of course and thanks!

I'd like to modify portions of state before they are sent depending on whether broadcastchannel is available and don't have a feasible way to separate those pieces otherwise. I.e. if there will be storage limitations that prevent the sending and receiving via the fallbacks for broadcastchannel.

@aohua I see a few issues that might cause someone to want to modify an action before it's shared. Namely general performance, storage limitations when broadcast channel isn't available, and the structured clone algorithm causing errors if some part of an action is not clonable.