I used RxJS (mostly copy and past, I confess) with ng/rx and I loved it.
Looking at the current PWA fashion it seems that state of the art is to have all network communication done in a webworker.
How does that work in RxJS? Can an Observable be shared across the boundary between webworker and main thread?
Is there some sample?
Very good question! It is something I entertained as well when I first learned about Web Workers, since they seem very conceptually related to threads.
That's not to say we can't use Web Workers to perform some heavy lifting, we would just use a different mechanism. Here is an admittedly toy example:
In the above we create what I like to call a "wrinkle in space and time" to create a Subject appears to be mapping inputs to outputs with as we normally see with our standard Subject, however in this case the inbound message is actually going to the Web Worker and the outbound message is the result sent back from the Web Worker, making it transparently inline with your stream.
Good night. Drive safely. Here's a tiny ad for the road: