Skip to content

Commit 34b8f33

Browse files
authored
feat(core): add app method on PluginApi (#6705)
1 parent 06fdcc0 commit 34b8f33

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.changes/plugin-api-handle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Add `app` method for the `PluginApi` struct.

core/tauri/src/plugin.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ impl<R: Runtime, C: DeserializeOwned> PluginApi<R, C> {
107107
pub fn config(&self) -> &C {
108108
&self.config
109109
}
110+
111+
/// Returns the application handle.
112+
pub fn app(&self) -> &AppHandle<R> {
113+
&self.handle
114+
}
110115
}
111116

112117
/// Builds a [`TauriPlugin`].

0 commit comments

Comments
 (0)