neuecc / UniRx

Reactive Extensions for Unity
MIT License
7.08k stars 891 forks source link

Take last value from MessageBroker.Default.Receive #502

Closed studentutu closed 2 years ago

studentutu commented 3 years ago

Please help! I need to take a last value from a message broker but it does not provides any values after the initial publish.

What we have : 1) Publish change on the MessageBroker and Start MVC transition 2) Controller is instantiated 3) Controller subscribes to MessageBroker.Default.Receive but it never give us the last value. We've tried every extension on it - select/where/take/retry etc. neither of them do anything to the MessageBroker.Default.Receive observable

How should we take a last value from a MessageBroker.Default.Receive()?

studentutu commented 2 years ago

as it stands right now - the only way of doing so is to use custom bus with a buffer. See implementation of boolean reactive property for clues on how to do so.