Skip to content

Instantly share code, notes, and snippets.

@johnhunter
Created February 15, 2017 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnhunter/d4fa3dc345da47dcdd3bc053f71d72ed to your computer and use it in GitHub Desktop.
Save johnhunter/d4fa3dc345da47dcdd3bc053f71d72ed to your computer and use it in GitHub Desktop.
exports.default = function (socket) {
return function (store) {
return function (next) {
return function (action) {
if (action.meta && action.meta.remote) {
var clientId = store.getState().get('clientId');
socket.emit('action', objectAssign({}, action, { clientId: clientId }));
}
return next(action);
};
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment