xilem_web: Add async_repeat
This is a first attempt to port xilem::async_repeat to xilem_web.
But for some reason the example does not compile:
error[E0277]: the trait bound `AsyncRepeat<{closure@xilem_web/web_examples/async_repeat/src/main.rs:21:9: 21:16}, {closure@xilem_web/web_examples/async_repeat/src/main.rs:27:9: 27:49}, Message>: View<AppState, (), ViewCtx, Box<(dyn xilem_web::Message + 'static)>>` is not satisfied
--> xilem_web/web_examples/async_repeat/src/main.rs:19:39
|
19 | fn app_logic(state: &mut AppState) -> impl Element<AppState> {
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `View<AppState, (), ViewCtx, Box<(dyn xilem_web::Message + 'static)>>` is not implemented for `AsyncRepeat<{[email protected]:21:9}, {[email protected]:27:9}, Message>`, which is required by `Fork<xilem_web::elements::html::Div<_, _>, AsyncRepeat<{closure@xilem_web/web_examples/async_repeat/src/main.rs:21:9: 21:16}, {closure@xilem_web/web_examples/async_repeat/src/main.rs:27:9: 27:49}, Message>>: Element<AppState>`
So the reason why this doesn't compile has to do with the two different
Messagetypes (as well asDynMessage).
Thank you! Now it works :smile:
Thank you! Now it works 😄
Good to know, I hope it's the same issue with AfterBuild etc.
The clippy suggestion is pretty dumb why CI fails... As if an endless loop doesn't have any side-effects...
Anyway, that example is somewhat redundant, as that should be a use-case for the new interval view now.
(Also I don't think we should use async_repeat_raw in an example, it's IMO mostly a hack to be able to capture stuff.)
Anyway, that example is somewhat redundant, as that should be a use-case for the new
intervalview now.
But now I added the "abort handle", that might be specific to async tasks.
Apart of nits, looks good, nice job with the
ShutdownSignal.
thank you 😊