From 4d261d047a251d141cbb9915514af9f480b001ed Mon Sep 17 00:00:00 2001 From: Henry Zimmerman Date: Mon, 18 Nov 2019 21:52:35 -0500 Subject: [PATCH] Add send_self_batch to ComponentLink --- src/html/mod.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/html/mod.rs b/src/html/mod.rs index b18cf6b4d7f..26772ec3a68 100644 --- a/src/html/mod.rs +++ b/src/html/mod.rs @@ -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) { + self.scope.send_message_batch(msgs) + } } impl fmt::Debug for ComponentLink {