yew/examples/async_clock
Jupp56 28e673a426
Add safe mode to joke api (#3429)
* Add safe mode to joke api

* cargo fmt
2023-10-02 19:20:14 +09:00
..
2023-10-02 19:20:14 +09: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 with the trunk development server:

trunk serve --open