kfiroo / react-native-cached-image

CachedImage component for react-native
MIT License
938 stars 470 forks source link

Added "isUrlCached" to ImageCacheManager API #113

Closed jln-dk closed 2 years ago

jln-dk commented 6 years ago

I have added an "isUrlCached" method to the ImageCacheManager API.

This is handy if you want to know if the URL has already been cached or not.
It uses the same "read from cache" logic as "cacheUrl", as I have extracted the "cache/file lookup" logic into a separate function called "getCachedFile".

Battle-tested this in my own application already.

jln-dk commented 6 years ago

@kfiroo Please have a look :)