| Crates.io | rx_core_observer_fn |
| lib.rs | rx_core_observer_fn |
| version | 0.2.0 |
| created_at | 2026-01-19 11:26:30.260278+00 |
| updated_at | 2026-01-24 15:04:00.183995+00 |
| description | fn observer for rx_core, it calls a closure |
| homepage | https://github.com/AlexAegis/rx_bevy |
| repository | https://github.com/AlexAegis/rx_bevy |
| max_upload_size | |
| id | 2054339 |
| size | 11,619 |
Define observers from callbacks: FnObserver (static dispatch) and DynFnObserver (dynamic dispatch).
cargo run -p rx_core --example observer_fn_example
let _subscription = just("world").subscribe(FnObserver::new(
|next| println!("hello: {next}"),
|_error| println!("error"),
|| {},
));
Output:
hello: world