tauri-apps / tauri-apps/tauri-docs
Events with YEW
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- MDX
- Stars
- 1.1k
- Forks
- 887
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 48
Description
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/
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 ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Tauri events guide linked in the issue and investigate how its emit and listen examples apply to a Yew frontend. Document the relevant Yew usage and verify that the page explains both emitting events and subscribing to them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100