June 2018
Intermediate to advanced
348 pages
8h 45m
English
We now understand the crux of reactive programming model, because we covered basic topics such as Observables, Observers, Operators, and Schedulers. There are some more Operators we should know about to write our logic better. In this section, we will cover the tap , defer and buffer Operators. We will first explore the tap Operator, which helps peek into the contents of the Stream:
//----------- TapExample.cpp #include "rxcpp/rx.hpp" #include "rxcpp/rx-test.hpp" #include <ioStream> int main() { //---- Create a mapped Observable auto ints = rxcpp::observable<>::range(1,3). map( [] ( int n ) {return n*n; }); //---- Apply the tap operator...The Operator //---- will act as a filter/debug operator auto values = ints.tap( ...Read now
Unlock full access