Redux-observable: Websocket example of your Netflix Javascript Talks video

Created on 9 Jun 2017  路  5Comments  路  Source: redux-observable/redux-observable

Hi,
I saw the great video about redux-observable. Thanks.
I am interested in the Websocket non-trivial example that you showed on slide.
Would you mind adding the stockTickerEpic with the rest of the redux code as an example?

help wanted

Most helpful comment

here's a working example of multiplexing a socket using a mock (aka fake) WebSocket server. If you don't need multiplexing, things are easier than this.

https://jsbin.com/rumese/edit?js,output

Enter whatever fake ticker symbols you want and add them e.g.
image

It has a bunch of code that isn't really used, but might help you later--just take the time to understand it and whether you want it or not! e.g. the retryWhen, removing the tickers, etc.

All 5 comments

Good idea. I'll try and find some time, though to be honest our examples in general are pretty lacking. It's mostly been "if you already know Rx you should know how to do stuff" but it's a good idea regardless. Hopefully I (or someone else) will find time to create more examples.

Your JsBin are great
Now simulating the websocket on a jsbin might be challenging but having a small example there could be just as good as an example on the repo

@jayphelps I came up with this: https://jsfiddle.net/rolele/ued0oh9q/

but I think I really miss the point here.
I think you might be able to look at the console and debug this quite quickly.

Hi @casertap did you ever get your web socket figured out? Do you have an updated jsbin?

Thanks

here's a working example of multiplexing a socket using a mock (aka fake) WebSocket server. If you don't need multiplexing, things are easier than this.

https://jsbin.com/rumese/edit?js,output

Enter whatever fake ticker symbols you want and add them e.g.
image

It has a bunch of code that isn't really used, but might help you later--just take the time to understand it and whether you want it or not! e.g. the retryWhen, removing the tickers, etc.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tomekmularczyk picture Tomekmularczyk  路  4Comments

ncuillery picture ncuillery  路  3Comments

jayphelps picture jayphelps  路  4Comments

MaximeBernard picture MaximeBernard  路  6Comments

connected-mgosbee picture connected-mgosbee  路  5Comments