auto sub = new ReplaySubject!int(1);
.put(sub, 1);
int[] buf;
auto d = sub.doSubscribe!(v => buf ~= v);
scope (exit)
d.dispose();
assert(buf.length == 1);
assert(buf[0] == 1);
auto sub = new ReplaySubject!int(1);
.put(sub, 1);
.put(sub, 2);
int[] buf;
auto d = sub.doSubscribe!(v => buf ~= v);
scope (exit)
d.dispose();
assert(buf == [2]);
auto sub = new ReplaySubject!int(2);
.put(sub, 1);
.put(sub, 2);
.put(sub, 3);
int[] buf;
auto d = sub.doSubscribe!(v => buf ~= v);
scope (exit)
d.dispose();
assert(buf == [2, 3]);