tauri-apps / tauri-apps/tauri-docs

Events with YEW

Open
#952 1 comment 3 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.