A small crate to sugar working with command callbacks in bevy.
```rust use bevy::prelude::; use moshimoshi::;
struct Button;
struct OnClick(EntityCallback);
struct Counter(u32);
struct Text(String);
fn setup(mut commands: Commands) { commands.spawn(( Button, Counter(0), Text("Click Me".tostring()), OnClick(moshi!([e: Entity], counter: Query<&mut Counter> => { **counter.getmut(e).unwrap() += 1; })) )); }
impl Button { fn update(mut commands: Commands, buttons: Query<(Entity, &OnClick), Changed
fn main() { App::new() .addsystems(Update, (Button::update, applydeferred).chain()) .run() } ```
| Bevy version | moshimoshi verison | |--------------|--------------------| | 0.11 | 0.1 - 0.2 |