yew/examples/async_clock
Kaede Hoshikawa 456a05ba40
Fix clippy for 1.67 (#3100)
* Fix clippy for 1.67

* Fix trybuild.
2023-02-01 21:57:05 +05:00
..
2023-02-01 21:57:05 +05:00
2022-10-03 16:33:16 +05:00
2022-10-03 16:33:16 +05:00
2022-10-03 16:33:16 +05:00
2022-10-03 16:33:16 +05:00

Asynchronous coding in Yew

An example of using asynchronous tasks in a component. This example creates a clock in the background and continuously awaits clock-ticks. When the clock updates the new time is sent to the UI component to display. In parallel it fetches online jokes to make the clock more entertaining to watch.

Its main purpose is to demonstrate various ways of using async code in a yew component. It uses the following async features:

  • send_future
  • send_stream
  • spawn_local
  • mpsc::unbounded channels

Running

Run this application:

trunk serve --open