diff options
author | Grigoriy Chudnov <g.chudnov@gmail.com> | 2016-05-18 13:56:22 +0300 |
---|---|---|
committer | Grigoriy Chudnov <g.chudnov@gmail.com> | 2016-05-18 13:56:22 +0300 |
commit | fb28894269959bf3dad9e5403b42c10c8ae3c1d7 (patch) | |
tree | e6d3edbf0afc71359e92ae9e2dfad017cdd5a3b5 /Rx/v2/examples | |
parent | b1b60ea89e175638407a323338676e865ed5ad15 (diff) | |
download | RxCpp-fb28894269959bf3dad9e5403b42c10c8ae3c1d7.tar.gz |
add take_last operator
Diffstat (limited to 'Rx/v2/examples')
-rw-r--r-- | Rx/v2/examples/doxygen/take_last.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Rx/v2/examples/doxygen/take_last.cpp b/Rx/v2/examples/doxygen/take_last.cpp new file mode 100644 index 0000000..eb3cdfc --- /dev/null +++ b/Rx/v2/examples/doxygen/take_last.cpp @@ -0,0 +1,15 @@ +#include "rxcpp/rx.hpp" + +#include "rxcpp/rx-test.hpp" +#include "catch.hpp" + + +SCENARIO("take_last sample"){ + printf("//! [take_last sample]\n"); + auto values = rxcpp::observable<>::range(1, 7).take_last(3); + values. + subscribe( + [](int v){printf("OnNext: %d\n", v);}, + [](){printf("OnCompleted\n");}); + printf("//! [take_last sample]\n"); +} |