Last active
May 14, 2021 18:58
-
-
Save amitrahav/d5850cd4bf8c26463a87c0adb4a4c3b2 to your computer and use it in GitHub Desktop.
SocketVsSSE
This file contains hidden or 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
// Listen for messages | |
sse.addEventListener("channel-name", function(e) { | |
console.log(e.data) | |
}) | |
// Listen for messages | |
socket.addEventListener("channel-name", function (event) { | |
console.log("Message from server", event.data); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment