status"error" | "idle" | "loading" |
usernull | User |
countnumber = 0 |
itemsItem[] = [] |
| S1 | status === "loading"<Spinner> |
| S2 | status !== "loading"∧!user<SignIn> |
| S3 | status !== "loading"∧user∧items.length > 0<main> <h1> {user.name} <List> <button> {count} |
| S4 | status !== "loading"∧user∧items.length <= 0<main> <h1> {user.name} <Empty> <button> {count} |
after first renderS3 → S4S4 → S3 if [{ id: "1", title: "First" }] resolvesitems = await [{ id: "1", title: "First" }] async |
setCount(count + 1)count = count + 1 |