File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
crates/bevy_flurx_ipc/src Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -24,21 +24,18 @@ pub struct IpcTriggerSender(Arc<Mutex<Vec<IpcTriggerMessage>>>);
24
24
impl IpcTriggerSender {
25
25
/// Push the [`IpcTriggerMessage`] into queue.
26
26
///
27
- /// The pushed event will be deserialized, and then will send as [`IpcEvent `].
27
+ /// The message pushed will be deserialized into the type registered with [`IpcTriggerExt::add_ipc_trigger `].
28
28
#[ inline( always) ]
29
29
pub fn send ( & self , event : IpcTriggerMessage ) {
30
30
self . 0 . lock ( ) . unwrap ( ) . push ( event) ;
31
31
}
32
32
}
33
33
34
- /// Add an [`IpcEvent`] into [`App`] .
34
+ /// Allows you to receive messages from Ipc as [`Trigger`](bevy::prelude::Trigger) .
35
35
pub trait IpcTriggerExt {
36
- /// This method registers [`IpcEvent<Payload>`](IpcEvent), which can be read just like a normal bevy event .
36
+ /// This method allows you to receive messages from Ipc as [`Trigger`]( bevy::prelude::Trigger) .
37
37
///
38
38
/// `event_id` is the id that associated with this event.
39
- ///
40
- /// From javascript side, you can emit the event as follows:
41
- /// `window.__FLURX__.emit(<event_id>, payload)`
42
39
fn add_ipc_trigger < Payload > ( & mut self , event_id : impl Into < String > ) -> & mut Self
43
40
where
44
41
Payload : DeserializeOwned + Event + Send + Sync + ' static ;
You can’t perform that action at this time.
0 commit comments