mirror of
https://github.com/tauri-apps/tauri-docs.git
synced 2026-01-31 00:35:16 +01:00
docs(migrate): JS specific event changes.
This commit is contained in:
@@ -191,10 +191,12 @@ Most of the environment variables read and written by the Tauri CLI were renamed
|
||||
|
||||
The event system was redesigned to be easier to use. Instead of relying on the source of the event, it now has a simpler implementation that relies on event targets.
|
||||
|
||||
- The `emit` function now emits the event to all event listeners
|
||||
- Added a new `emit_to` function to trigger an event to a specific target
|
||||
- The `emit` function now emits the event to all event listeners.
|
||||
- Added a new `emit_to`/`emitTo` function to trigger an event to a specific target.
|
||||
- `emit_filter` now filters based on [`EventTarget`](https://docs.rs/tauri/2.0.0/tauri/event/enum.EventTarget.html) instead of a window.
|
||||
- Renamed `listen_global` to `listen_any`. It now listens to all events regardless of their filters and targets.
|
||||
- JavaScript: `event.listen()` behaves similar to `listen_any`. It now listens to all events regardless of their filters and targets, unless a target is set in the `Options`.
|
||||
- JavaScript: `WebviewWindow.listen` etc. only listen to events emitted to the respective `EventTarget`.
|
||||
|
||||
### Multiwebview support
|
||||
|
||||
|
||||
Reference in New Issue
Block a user