#include <rpp/rpp.hpp>
#include <iostream>
int main()
{
rpp::source::create<int>([](const auto& sub)
{
sub.on_next(42);
})
.subscribe([](int v) { std::cout << v << std::endl; });
{
})
.subscribe([](int v) { std::cout << v << std::endl; });
int val = 42;
rpp::source::create<int>([val](const auto& sub)
{
sub.on_next(val);
})
.subscribe([](int v) { std::cout << v << std::endl; });
}
subscriber which uses dynamic_observer<T> to hide original callbacks
Definition: dynamic_subscriber.hpp:24