Skip to content

Instantly share code, notes, and snippets.

@BlakeWilliams
Created September 26, 2015 01:29
Show Gist options
  • Select an option

  • Save BlakeWilliams/2bf218160917ad9a5ed0 to your computer and use it in GitHub Desktop.

Select an option

Save BlakeWilliams/2bf218160917ad9a5ed0 to your computer and use it in GitHub Desktop.
export default function socketUpdates(dispatch) {
socket.connect({ token: localStorage.token });
const channel = socket.channel('update');
channel.on('model:add', model => {
dispatch(addModel(model));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment