mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-05 10:13:00 +02:00
Unlisten to an event on this window (#2664)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
5
.changes/unlisten.md
Normal file
5
.changes/unlisten.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Adds `unlisten` function to the `Window` struct.
|
||||
@@ -271,6 +271,11 @@ impl<R: Runtime> Window<R> {
|
||||
self.manager.listen(event.into(), Some(label), handler)
|
||||
}
|
||||
|
||||
/// Unlisten to an event on this window.
|
||||
pub fn unlisten(&self, handler_id: EventHandler) {
|
||||
self.manager.unlisten(handler_id)
|
||||
}
|
||||
|
||||
/// Listen to a an event on this window a single time.
|
||||
pub fn once<F>(&self, event: impl Into<String>, handler: F) -> EventHandler
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user