Chapter 4. Real-Time Chat
After having written two applications with Angular 2, we will now create one with React. The server part will also be different. Instead of a connectionless server, we will now create a server with a persistent connection. In the previous chapters, the client sent requests to the server and the server responded to them. Now we will write a server that can send information at any time to the client. This is needed to send new chat messages immediately to the client, as shown in the following:
In the chat application, a user can first choose a username and join a chat room. In the room, he/she can send messages and receive ...
Get TypeScript: Modern JavaScript Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.