From 88a2310de29d757264a0b6d5daffacb0cf38e754 Mon Sep 17 00:00:00 2001
From: Colin White <colin@colinwhite.me>
Date: Tue, 28 Jan 2025 11:32:53 -0800
Subject: [PATCH] Fix incorrect docs.

---
 coil-compose/README.md | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/coil-compose/README.md b/coil-compose/README.md
index fe2cb44c8f..cdf790606f 100644
--- a/coil-compose/README.md
+++ b/coil-compose/README.md
@@ -113,12 +113,11 @@ Specifically, this function is only useful if you need to observe `AsyncImagePai
 
 ## Observing AsyncImagePainter.state
 
-Example:
-
 ```kotlin
 val painter = rememberAsyncImagePainter("https://example.com/image.jpg")
+val state by painter.state.collectAsState()
 
-when (painter.state) {
+when (state) {
     is AsyncImagePainter.State.Empty,
     is AsyncImagePainter.State.Loading -> {
         CircularProgressIndicator()