Skip to content

Commit 1d941a0

Browse files
authored
docs(migrate): JS specific event changes.
1 parent b701b2d commit 1d941a0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/content/docs/start/migrate/from-tauri-1.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,12 @@ Most of the environment variables read and written by the Tauri CLI were renamed
191191

192192
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.
193193

194-
- The `emit` function now emits the event to all event listeners
195-
- Added a new `emit_to` function to trigger an event to a specific target
194+
- The `emit` function now emits the event to all event listeners.
195+
- Added a new `emit_to`/`emitTo` function to trigger an event to a specific target.
196196
- `emit_filter` now filters based on [`EventTarget`](https://docs.rs/tauri/2.0.0/tauri/event/enum.EventTarget.html) instead of a window.
197197
- Renamed `listen_global` to `listen_any`. It now listens to all events regardless of their filters and targets.
198+
- 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`.
199+
- JavaScript: `WebviewWindow.listen` etc. only listen to events emitted to the respective `EventTarget`.
198200

199201
### Multiwebview support
200202

0 commit comments

Comments
 (0)