A simple Iced project to show how to create an application that has different states using Application and async functions

This is an application that fetches a joke using the jokes API and displays it.

It has 3 states
Loading → Where it runs an async function to get the joke from the API and handle any errors

Loaded → Where it displays the joke.

Error → Displays an error if something goes wrong.

I made this mainly to ease anyone who’s struggling/wants to make complicated application that has different states.

this is link to the git repo with the code (also includes the documentation I wrote.)

The docs aren’t perfect and English isn’t my first language, so if you have any feedback or questions send them and I will update and change the docs as needed.

1 Like