Skip to content

Events with YEW #952

Open
Open
@memodyssey

Description

@memodyssey

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementDoes it add or improve content?

    Type

    No type

    Projects

    Status

    💪 Ready

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions