How to combine two DisposeBags?

175 views Asked by At

Is there any built-in way to combine two or more DisposeBags merging them in a single one which triggers as soon as the first trigger?

The use case is something like this: I have a UIViewController with some controls and his own disposeBag; then I have a library which asynchronously hands some data to this UIViewController. This data comes with his own disposeBag, which is bound to some independent logic (network connections basically). I want to bind the data to the controls, and dispose the binding as soon as one of the two DisposeBag is triggered.

1

There are 1 answers

0
Nikita Ermolenko On

I haven't tried it before, but try CompositeDisposable.