Creates a sub-observable consisting of only up to the first n elements of the given source.
import std.array; import rx.subject; auto pub = new SubjectObject!int; auto sub = appender!(int[]); auto d = pub.take(2).subscribe(sub); foreach (i; 0 .. 10) { pub.put(i); } import std.algorithm; assert(equal(sub.data, [0, 1]));
See Implementation
Creates a sub-observable consisting of only up to the first n elements of the given source.