Skip to content

Instantly share code, notes, and snippets.

@Ibro
Created November 17, 2017 06:11
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 Ibro/4fdaa6c8e80941fa007e677b4ab3fc6b to your computer and use it in GitHub Desktop.
Save Ibro/4fdaa6c8e80941fa007e677b4ab3fc6b to your computer and use it in GitHub Desktop.
ASP.NET Core SignalR chat with React.js - https://codingblast.com/asp-net-core-signalr-chat-react
this.state.hubConnection.on('sendToAll', (nick, receivedMessage) => {
const text = `${nick}: ${receivedMessage}`;
const messages = this.state.messages.concat([text]);
this.setState({ messages });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment