tauri/.changes/event-once.md
chip ece243d17c
don't remove once listener on new thread (#1506)
Spawning an async task to remove the once listener caused it to be able to be
called multiple times before being removed. This design choice was previously
made due to deadlock happening when removing the event from inside `fn once`.
That was because the listeners were already locked inside the trigger when
asked to be removed. `fn trigger` now handles removing once handlers
2021-04-15 08:11:42 +02:00

375 B

tauri
patch

Prevent "once" events from being able to be called multiple times.

  • Window::trigger(/*...*/) is now properly pub instead of pub(crate).
  • Manager::once_global(/*...*/) now returns an EventHandler.
  • Window::once(/*...*/) now returns an EventHandler.
  • (internal) event::Listeners::trigger(/*...*/) now handles removing "once" events.