Last active
November 17, 2017 06:11
-
-
Save Ibro/8f21b48a025c64dc5e0a7a62abed0c04 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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentDidMount = () => { | |
const nick = window.prompt('Your name:', 'John'); | |
const hubConnection = new HubConnection('http://localhost:5000/chat'); | |
this.setState({ hubConnection, nick }, () => { | |
this.state.hubConnection | |
.start() | |
.then(() => console.log('Connection started!')) | |
.catch(err => console.log('Error while establishing connection :(')); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment