pub enum JsEvent {
Event(NodeId, EventKind, EventPayload),
Component {
host: NodeId,
event: Box<dyn EventToJs>,
},
Children {
host: NodeId,
wanted: bool,
},
Render {
host: NodeId,
prop: &'static str,
key: SharedString,
value: Rc<dyn RenderValue>,
func: Option<Rc<dyn CallbackHandle>>,
},
Unrender {
host: NodeId,
prop: &'static str,
key: SharedString,
},
Reply {
call: u32,
result: JsResult,
},
// some variants omitted
}Expand description
What the core hands JS after a commit, in order: the platform’s and the core’s events, and the Rust values for JS (a Rust component’s events, whether its lazy children are placed, calls’ results).
Variants§
Event(NodeId, EventKind, EventPayload)
An event of a node (layout, scroll, a platform component’s).
Component
An event of the Rust component hosted by host.
Children
Whether the Rust component hosted by host places its lazy
children now.
Render
The Rust component hosted by host places the content of its
render prop prop (Option<Renderer<T>>) for key with value,
which JS did not render yet: JS calls the app’s function with it
and inserts what it returns into the host in a holder view of its
own (componentRender: the prop, U+001F, the key), replacing the
one it made for the key before. The core places the holder.
Fields
key: SharedStringThe key, unique among the component’s renders of the prop.
Unrender
No element of the component’s render (prop, key) is placed any
more (Self::Render): JS removes its holder and disposes what it
rendered.
Fields
key: SharedStringThe key.
Reply
The result of call call (its promise settles).