ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
window.cpp
#include <rpp/rpp.hpp>
#include <iostream>
int main()
{
rpp::source::just(1, 2, 3, 4, 5)
| rpp::operators::subscribe([](const rpp::window_observable<int>& v) {
std::cout << "\nNew observable " << std::endl;
v.subscribe([](int v) { std::cout << v << " "; });
});
// Output: New observable
// 1 2 3
// New observable
// 4 5
return 0;
}
auto just(const TScheduler &scheduler, T &&item, Ts &&... items)
Creates rpp::observable that emits a particular items and completes.
Definition from.hpp:201
auto window(size_t count)
Subdivide original observable into sub-observables (window observables) and emit sub-observables of i...
Definition window.hpp:150
auto subscribe(observer< Type, ObserverStrategy > &&observer)
Subscribes passed observer to emissions from this observable.
Definition subscribe.hpp:226