mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
21 lines
592 B
Rust
21 lines
592 B
Rust
use crate::handlers::*;
|
|
use flowy_client_ws::FlowyWebSocketConnect;
|
|
use flowy_derive::{Flowy_Event, ProtoBuf_Enum};
|
|
use lib_dispatch::prelude::*;
|
|
use std::sync::Arc;
|
|
use strum_macros::Display;
|
|
|
|
pub fn init(ws_conn: Arc<FlowyWebSocketConnect>) -> AFPlugin {
|
|
AFPlugin::new()
|
|
.name("Flowy-Network")
|
|
.state(ws_conn)
|
|
.event(NetworkEvent::UpdateNetworkType, update_network_ty)
|
|
}
|
|
|
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, Display, Hash, ProtoBuf_Enum, Flowy_Event)]
|
|
#[event_err = "FlowyError"]
|
|
pub enum NetworkEvent {
|
|
#[event(input = "NetworkStatePB")]
|
|
UpdateNetworkType = 0,
|
|
}
|