merge

  1. MergeObservable!(T1, T2) merge(auto ref T1 observable1, auto ref T2 observable2)
    MergeObservable!(T1, T2)
    merge
    (
    T1
    T2
    )
    (
    auto ref T1 observable1
    ,
    auto ref T2 observable2
    )
  2. auto merge(auto ref TObservable observable)

Examples

1 import rx.subject : SubjectObject;
2 
3 auto s1 = new SubjectObject!int;
4 auto s2 = new SubjectObject!short;
5 
6 auto merged = s1.merge(s2);
7 
8 int count = 0;
9 auto d = merged.doSubscribe((int n) { count++; });
10 
11 assert(count == 0);
12 s1.put(1);
13 assert(count == 1);
14 s2.put(2);
15 assert(count == 2);
16 
17 d.dispose();
18 
19 s1.put(10);
20 assert(count == 2);
21 s2.put(100);
22 assert(count == 2);