New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can you please add usage example ... #47
Comments
I noticed several nice things in component, so I gave it a more effort to understand it. I'm quite new to whole js world and not that familiar with rx, but following code from send method ...
is surprising for me. Lets assume, that we've been 'sending' messages, but destination was in failure, so messages just accumulated. Now finally destination went up. We send yet another message, using send as with previous messages. Issues:
|
that's true, but it's not inconvenience. It's fundamentally wrong I believe. Since you're not subscribing to response (what I'd expect, but that would require doing some pairing request/response which is not present). You're subscribing to 'error stream', which is counterintuitive. And this stream produces items rarely and never completes. This made me to rewrite this tool for myself... |
I might be reading issue #41 and its comments wrong, but I think the consensus is "it's wrong" |
The pattern from the example doesn't work. |
Hi,
Can you please add usage example ...
I tried to use:
let websocket = new $WebSocket("…");
let observable: Observable = this.websocket.send("test");
observable.subscribe(
value=>console.log("nextValue: " + value),
err=>console.log("error: " + err),
()=>console.log("done.")
);
message arrives to backend, it's returned (to other client), but nothing is logged in console here. Same for using subject.
By using following instead of that:
this.websocket = new $WebSocket("ws://localhost:8280/gerrit-helper/test-websocket-endpoint");
this.websocket.onMessage(function (e) { console.log(e); }, null);
let observable: Observable = this.websocket.send("test");
and subscription to cold observable...
this 'works', but seems really wrong. Why does subscription in first excerpt does not work? (when using Observable.range to verify it seems to work as expected).
Thanks.
The text was updated successfully, but these errors were encountered: