#How do I emit an event inside of command?

2 messages · Page 1 of 1 (latest)

long geyser
#

I am trying to figure out how do I emit an event inside of a command, but none of it succeed..

here's what I did first.. but it didn't work

#[tauri::command]
pub fn some_command(app: tauri::App) {
    app.emit_all("an-event", /* .. */).unwrap();
}

also worth noting that, this is also inside of a plugin

clear whale
#

Try app.handle().emit_all(event, payload).unwrap()