import { emit, listen } from '@tauri-apps/api/event'
// listen to the `click` event and get a function to remove the event listener
// there's also a `once` function that subscribes to an event and automatically unsubscribes the listener on the first event
const unlisten = await listen('click', (event) => {
// event.event is the event name (useful if you want to use a single callback fn for multiple event types)
// event.payload is the payload object
}
// emits the `click` event with the object payload
emit('click', {
theMessage: 'Tauri is awesome!',
})
Is there any way to do this with a frontend built with rust ?
Can we get this page documented with yew ?
This is the sort of thing that's the reason I really want us to take over the tauri-sys project, so we can offer the JS API in a nice manner to Rust based frontends as well.
Hello, I would like to implement the emit function with Yew but I don't how can I implement it especially the listen function https://tauri.app/v1/guides/features/events/
Is there any way to do this with a frontend built with rust ? Can we get this page documented with yew ?