mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-27 06:30:20 +00:00
Document ipc a bit
This commit is contained in:
parent
b5a125b963
commit
4d95bc1374
1 changed files with 7 additions and 0 deletions
|
@ -1,20 +1,27 @@
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use tao::window::WindowId;
|
use tao::window::WindowId;
|
||||||
|
|
||||||
|
/// A pair of data
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct UserWindowEvent(pub EventData, pub WindowId);
|
pub struct UserWindowEvent(pub EventData, pub WindowId);
|
||||||
|
|
||||||
|
/// The data that might eminate from any window/webview
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum EventData {
|
pub enum EventData {
|
||||||
|
/// Poll the virtualdom
|
||||||
Poll,
|
Poll,
|
||||||
|
|
||||||
|
/// Handle an ipc message eminating from the window.postMessage of a given webview
|
||||||
Ipc(IpcMessage),
|
Ipc(IpcMessage),
|
||||||
|
|
||||||
|
/// Handle a hotreload event, basically telling us to update our templates
|
||||||
#[cfg(all(feature = "hot-reload", debug_assertions))]
|
#[cfg(all(feature = "hot-reload", debug_assertions))]
|
||||||
HotReloadEvent(dioxus_hot_reload::HotReloadMsg),
|
HotReloadEvent(dioxus_hot_reload::HotReloadMsg),
|
||||||
|
|
||||||
|
/// Create a new window
|
||||||
NewWindow,
|
NewWindow,
|
||||||
|
|
||||||
|
/// Close a given window (could be any window!)
|
||||||
CloseWindow,
|
CloseWindow,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue