rx_bevy_observable_resource

Crates.iorx_bevy_observable_resource
lib.rsrx_bevy_observable_resource
version0.3.1
created_at2026-01-19 07:04:03.224477+00
updated_at2026-01-24 17:58:40.784957+00
descriptionrx_bevy resource observable
homepagehttps://github.com/AlexAegis/rx_bevy
repositoryhttps://github.com/AlexAegis/rx_bevy
max_upload_size
id2053892
size137,283
Sandor (AlexAegis)

documentation

https://github.com/AlexAegis/rx_bevy

README

observable_resource

crates.io ci codecov license

The ResourceObservable call a "reader" function on an observable every time it is added or mutated, emitting the result to subscribers.

See Also

Options

  • trigger_on_is_added: Emit also when the resource was just added. (Default: true)
  • trigger_on_is_changed: Emit on each tick where the resource was accessed mutably, except when the resource was just added. (Default: true)

Example

cargo run -p rx_bevy --example observable_resource_example
ResourceObservable::<DummyResource, _, usize>::new(
    |res| res.count,
    ResourceObservableOptions {
        trigger_on_is_added: true,
        trigger_on_is_changed: true,
    },
    rx_schedule_update_virtual.handle(),
)
.subscribe(PrintObserver::new("resource_observable"));
Commit count: 652

cargo fmt