1 #include "rxcpp/rx.hpp"
2 
3 #include "rxcpp/rx-test.hpp"
4 #include "catch.hpp"
5 
6 SCENARIO("debounce sample"){
7     printf("//! [debounce sample]\n");
8     using namespace std::chrono;
9     auto scheduler = rxcpp::identity_current_thread();
10     auto start = scheduler.now();
11     auto period = milliseconds(10);
12     auto values = rxcpp::observable<>::interval(start, period, scheduler).
13         take(4).
14         debounce(period);
15     values.
16         subscribe(
__anon6fe64c0d0102(long v) 17             [](long v) { printf("OnNext: %ld\n", v); },
__anon6fe64c0d0202() 18             []() { printf("OnCompleted\n"); });
19     printf("//! [debounce sample]\n");
20 }