ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
create.cpp
#include <rpp/rpp.hpp>
#include <iostream>
int main() // NOLINT(bugprone-exception-escape)
{
rpp::source::create<int>([](const auto& sub) {
sub.on_next(42);
})
.subscribe([](int v) { std::cout << v << std::endl; });
// Output: 42
int val = 42;
rpp::source::create<int>([val](const auto& sub) {
sub.on_next(val);
})
.subscribe([](int v) { std::cout << v << std::endl; });
// Output: 42
}
auto create(OnSubscribe &&on_subscribe)
Construct observable specialized with passed callback function. Most easiesest way to construct obser...
Definition create.hpp:57