#include <rpp/rpp.hpp>
#include <iostream>
int main()
{
rpp::source::just(1, 2, 3)
.switch_map([](int val) {
if (val == 1)
return rpp::source::never<int>()
sub.
get_subscription().add([&]() {
std::cout << "x-";
});
return sub;
})
.as_dynamic();
return rpp::source::from_iterable(std::vector{val, val})
.as_dynamic();
})
.subscribe([](int v) { std::cout << v << "-"; });
return 0;
}
subscriber which uses dynamic_observer<T> to hide original callbacks
Definition: dynamic_subscriber.hpp:24