# Adjust image cache APIs to enable ElementState based APIs \(\#29243\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/3705986facbf0ed1750044aa37c413a4d5fe6d36)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 3705986facbf0ed1750044aa37c413a4d5fe6d36

Requested commit: 3705986facbf0ed1750044aa37c413a4d5fe6d36

Commit: 3705986facbf0ed1750044aa37c413a4d5fe6d36

Tree: 597a574879fa6ce21dff5aea70194c7d2831ba59

Author: Mikayla Maki

Committer: GitHub

## Message

```
Adjust image cache APIs to enable ElementState based APIs (#29243)

cc: @sunli829 @huacnlee @probably-neb 

I really liked the earlier PR, but had an idea for how to utilize the
element state so that you don't need to construct the cache externally.
I've updated the APIs to introduce an `ImageCacheProvider` trait, and
added an example implementation of it to the image gallery :)

Release Notes:

- N/A
```

## Parents

- [aefb3aa2faca5b4b5f7a6f88c75de2042dec8e11](https://git.cafe/gitcafe/zed/commit/aefb3aa2faca5b4b5f7a6f88c75de2042dec8e11?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/3705986facbf0ed1750044aa37c413a4d5fe6d36?format=markdown)
