Skip to content

Commit

Permalink
Add doc for ambients
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbanes committed Oct 26, 2020
1 parent cdb9f80 commit f2112d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion coil/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ Accompanist Coil supports GIFs through Coil's own GIF support. Follow the [setup
## Custom ImageLoader

If you wish to provide a default [`ImageLoader`](https://coil-kt.github.io/coil/image_loaders/) to use across all of your `CoilImage`
calls, we provide the `AmbientImageLoader` ambient. You can see it like so:
calls, we provide the `AmbientImageLoader` ambient.

You can use it like so:

``` kotlin
val imageLoader = ImageLoader.Builder(context)
Expand All @@ -111,6 +113,8 @@ Providers(AmbientImageLoader provides imageLoader) {
}
```

For more information on ambients, see [here](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Ambient).

## Download

```groovy
Expand Down
5 changes: 4 additions & 1 deletion picasso/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ PicassoImage(
## Custom Picasso

If you wish to provide a default `Picasso` to use across all of your `PicassoImage`
calls, we provide the `AmbientPicasso` ambient. You can see it like so:
calls, we provide the `AmbientPicasso` ambient.

You can use it like so:

``` kotlin
val picasso = Picasso.Builder(...)
Expand All @@ -107,6 +109,7 @@ Providers(AmbientPicasso provides picasso) {
}
```

For more information on ambients, see [here](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Ambient).

## Download

Expand Down

0 comments on commit f2112d6

Please sign in to comment.