ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
last.cpp
#include <rpp/rpp.hpp>
#include <iostream>
int main()
{
rpp::source::just(1, 2, 3, 4, 5)
[](const auto& v) { std::cout << "-" << v; },
[](const std::exception_ptr&) {},
[]() { std::cout << "-|" << std::endl; });
// Source: -1-2-3-4-5--|
// Output: -5-|
[](const auto& v) { std::cout << "-" << v; },
[](const std::exception_ptr&) { std::cout << "-x"; },
[]() { std::cout << "-|" << std::endl; });
// Source: -1-2-3-4-5--|
// Output: -x
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 empty()
Creates rpp::observable that emits no items but terminates normally.
Definition empty.hpp:48
auto last()
Emit only the last item provided before on_completed.
Definition last.hpp:95
auto subscribe(observer< Type, ObserverStrategy > &&observer)
Subscribes passed observer to emissions from this observable.
Definition subscribe.hpp:226