merge

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

Examples

import rx.subject : SubjectObject;

auto s1 = new SubjectObject!int;
auto s2 = new SubjectObject!short;

auto merged = s1.merge(s2);

int count = 0;
auto d = merged.doSubscribe((int n) { count++; });

assert(count == 0);
s1.put(1);
assert(count == 1);
s2.put(2);
assert(count == 2);

d.dispose();

s1.put(10);
assert(count == 2);
s2.put(100);
assert(count == 2);

Meta