I am trying to learn RxJS with websockets and Angular 4, and found a good example here. I\'m hoping someone can help explain the example as a few things are confusing.
in the example you gave it would probably be something like (when you have a instance of chatService)
let sub = chatService.messages.subscribe(()=>{
// do your stuff
});
// some where in your code
sub.unsubscribe() // this will close the connection
already answered in 3