I have a NodeJS application using Redux on the server for state management. I have multiple sibling Redux stores, and these stores are also running sagas.
(I'm not looking to discuss the merits of the multiple store approach, I have a Redux store per player, it was a considered decision and it works well for me)
I have a number of places where I am doing this, creating a new action for each:
for (const player of players) {
player.store.dispatch(playerChatAction(senderId, message));
}
I am wondering if there are likely to be any issues with creating a single action and dispatching it to them all.
const action = playerChatAction(senderId, message);
for (const player of players) {
player.store.dispatch(action);
}