Simple sync/async event dispatcher for Rust
use epicenter::{Event, AsyncDispatcher};
#[derive(Debug, Clone)]
struct ExampleEvent {}
impl Event for ExampleEvent {}
let mut dispatcher = AsyncDispatcher::new();
dispatcher.listen(|event: ExampleEvent| async move {
// ...
}).await;
dispatcher.dispatch(&ExampleEvent {}).await?;
Refer to the documentation on docs.rs for detailed usage instructions.
This project is licensed under the MIT License - see the LICENSE file for details.