Skip to content

Commit fe80824

Browse files
Update src/content/docs/develop/state-management.mdx
1 parent c8f819b commit fe80824

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/content/docs/develop/state-management.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ Note that the return type must be [`Result`] if you use asynchronous commands.
126126
Sometimes you may need to access the state outside of commands, such as in a different thread or in an event handler like `on_window_event`. In such cases, you can use the `state()` method of types that implement the [`Manager`] trait (such as the `AppHandle`) to get the state:
127127

128128
```rust
129+
use std::sync::Mutex;
129130
use tauri::{Builder, Window, WindowEvent, Manager};
130131

131132
#[derive(Default)]

0 commit comments

Comments
 (0)