rs_events 0.1.0

A flexible and ergonomic event emission crate for Rust. Supports both std/threaded and no_std/alloc environments, with tagging, listener lifetimes, async/sync emission, and robust error handling.
Documentation
//! Example: GUI button click event
#![no_std]
extern crate alloc;
use alloc::{
    string::{String, ToString},
    sync::Arc,
};
use rs_events::{EventEmitter, EventHandler};

fn main() {
    let mut emitter = EventEmitter::<String>::default();
    emitter
        .add(
            "button_click",
            None,
            Arc::new(|payload| {
                // Handle button click event
                let _value = payload.as_ref();
            }),
        )
        .unwrap();

    // Simulate button click
    emitter
        .emit("button_click", Arc::new("OK".to_string()))
        .unwrap();
}