#include <rpp/rpp.hpp>
#include <iostream>
int main()
{
auto key = grouped_observable.get_key();
std::cout << "new grouped observable " << key << std::endl;
grouped_observable.subscribe([key](int val) {
std::cout << "key [" << key << "] Val: " << val << std::endl;
});
});
struct person
{
std::string name;
int age;
};
person{"Alex", 25},
person{"Nick", 18},
person{"Jack", 25},
person{"Tom", 30},
person{"Vanda", 18})
grouped_observable.subscribe([age = grouped_observable.get_key()](const std::string& name) {
std::cout << "Age [" << age << "] Name: " << name << std::endl;
});
});
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 subscribe(observer< Type, ObserverStrategy > &&observer)
Subscribes passed observer to emissions from this observable.
Definition subscribe.hpp:226