Skip to content

Commit

Permalink
Fix incorrect docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrtwhite committed Jan 28, 2025
1 parent 66e5615 commit 88a2310
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions coil-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 88a2310

Please sign in to comment.