aldanor / reactive-rs

Streams and broadcasts: functional reactive programming in Rust.
MIT License
35 stars 3 forks source link

How to combine two streams? (Rx equivalent combine_latest) #4

Open teohhanhui opened 4 years ago

teohhanhui commented 4 years ago

I'm trying to understand how to produce a stream which combines inputs from multiple streams.

teohhanhui commented 4 years ago

~I haven't handled context (because it's an unsized type, and I'm still new to Rust...), but~ this seems to work: https://gist.github.com/teohhanhui/8203976a2de6b74bf198e098cd906650

Would you be open to adding this operator?

Edit: Updated to require Clone + Sized for context. Edit: Also implemented with_latest_from.