mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
Add send_self_batch to ComponentLink (#748)
This commit is contained in:
parent
0f890fd41b
commit
91d8a893d5
@ -411,7 +411,7 @@ where
|
||||
closure.into()
|
||||
}
|
||||
|
||||
#[cfg(all(target_arch = "wasm32", not(target_os="wasi"), not(cargo_web)))]
|
||||
#[cfg(all(target_arch = "wasm32", not(target_os = "wasi"), not(cargo_web)))]
|
||||
/// This method processes a Future that returns a message and sends it back to the component's
|
||||
/// loop.
|
||||
///
|
||||
@ -441,6 +441,15 @@ where
|
||||
pub fn send_self(&mut self, msg: COMP::Message) {
|
||||
self.scope.send_message(msg);
|
||||
}
|
||||
|
||||
/// Sends a batch of messages to the component to be processed immediately after
|
||||
/// the component has been updated and/or rendered..
|
||||
///
|
||||
/// All messages will first be processed by `update`, and if _any_ of them return `true`,
|
||||
/// then re-render will occur.
|
||||
pub fn send_self_batch(&mut self, msgs: Vec<COMP::Message>) {
|
||||
self.scope.send_message_batch(msgs)
|
||||
}
|
||||
}
|
||||
|
||||
impl<COMP: Component> fmt::Debug for ComponentLink<COMP> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user