Replies: 2 comments 1 reply
-
yew agent can do in the while loop like this: EventBus::dispatcher() .send(SomeMessage); |
Beta Was this translation helpful? Give feedback.
0 replies
-
maybe yew can add a pub fn send_stream<S, M>(&self, stream: S)
where
M: Into<COMP::Message>,
S: Stream<Item = M> + 'static,
{
let link = self.clone();
let js_future = async move {
while let Some(msg) = stream.next().await {
let message: COMP::Message = msg.into();
link.send_message(message);
}
};
spawn_local(js_future);
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I can't send message in a stream iter?
stream from here:
Beta Was this translation helpful? Give feedback.
All reactions