ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
map.cpp
#include <rpp/rpp.hpp>
#include <iostream>
int main() // NOLINT(bugprone-exception-escape)
{
| rpp::operators::map([](int value) { return value + 10; })
| rpp::operators::subscribe([](int v) { std::cout << v << std::endl; });
// Output: 52
| rpp::operators::map([](int value) { return std::to_string(value) + " VAL"; })
| rpp::operators::subscribe([](const std::string& v) { std::cout << v << std::endl; });
// Output: 42 VAL
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 map(Fn &&callable)
Transforms the items emitted by an Observable via applying a function to each item and emitting resul...
Definition map.hpp:94
auto subscribe(observer< Type, ObserverStrategy > &&observer)
Subscribes passed observer to emissions from this observable.
Definition subscribe.hpp:226