Philosophy of Rx operators
If you take any reactive program, we see a chain of operators stacked between the Observable and the Observer. The developers use a fluent interface to chain operators. In RxCpp, one can use a dot (.
) or pipe (|
) to perform the operator chaining. From a software interface point of view, every operator takes an Observable and returns an Observable of the same kind or a different kind.
The general usage of an RxCpp Observable/Observer interaction (given as pseudo-code) is as follows:
Observable(). // Source Observable
Op1(). // First operator
Op2(). // Second operator
..
..
Opn().subscribe( on_datahandler,
on_errorhandler,
on_completehandler);
Even though we are using fluent interfaces when it comes to operator chaining, we are effectively composing functions together. To compose functions together...