| Crates.io | rx_bevy_observable_event |
| lib.rs | rx_bevy_observable_event |
| version | 0.3.1 |
| created_at | 2026-01-19 06:34:15.524148+00 |
| updated_at | 2026-01-24 17:58:06.330754+00 |
| description | rx_bevy event observable, a glue between regular bevy events and observables |
| homepage | https://github.com/AlexAegis/rx_bevy |
| repository | https://github.com/AlexAegis/rx_bevy |
| max_upload_size | |
| id | 2053858 |
| size | 137,558 |
The EventObservable turns Bevy events triggered on an entity into signals,
allowing you to use any event as an observable source, and construct reactive
pipelines from them using operators.
Subscribers will observe events targeted at the specified entity, and a completion signal once the entity is despawned.
MessageWriter.cargo run -p rx_bevy --example observable_event_example
#[derive(Resource, Deref, DerefMut)]
pub struct DummyEventTarget(Entity);
#[derive(Resource, Default, Deref, DerefMut)]
pub struct ExampleSubscriptions(SharedSubscription);
fn setup(
mut commands: Commands,
rx_schedule_update_virtual: RxSchedule<Update, Virtual>,
mut subscriptions: ResMut<ExampleSubscriptions>,
) {
commands.spawn((
Camera3d::default(),
Transform::from_xyz(2., 6., 8.).looking_at(Vec3::ZERO, Vec3::Y),
));
let watched_entity = commands.spawn(Name::new("Watch me")).id();
subscriptions.add(
EventObservable::<DummyEvent>::new(watched_entity, rx_schedule_update_virtual.handle())
.subscribe(PrintObserver::new("event_observable")),
);
commands.insert_resource(DummyEventTarget(watched_entity));
}
Then, provided something is triggering DummyEvents on the watched entity:
Producer is sending DummyEvent { target: 6v1#4294967302 } to 6v1!
event_observable - next: DummyEvent { target: 6v1#4294967302 }
Producer is sending DummyEvent { target: 6v1#4294967302 } to 6v1!
event_observable - next: DummyEvent { target: 6v1#4294967302 }
...