DylanVann / react-native-fast-image

🚩 FastImage, performant React Native image component.
MIT License
8.15k stars 1.5k forks source link

Detect if image is in cache #293

Open cmmartin opened 6 years ago

cmmartin commented 6 years ago

Is there any way to detect if an image is in the cache?

My use case is that I want to do a progressive image loading effect when the image is not cached (fade in on load). However, I don't want the fade when the image is cached, because it is better to just show the image immediately in that case

chadmg commented 5 years ago

+1 I'm currently looking for this same solution

DavoCg commented 5 years ago

+1 I was here for the same use case !

n1ru4l commented 5 years ago

This will be possible once https://github.com/DylanVann/react-native-fast-image/pull/228 is implemented

compojoom commented 5 years ago

Please check #351

nathantqn commented 4 years ago

+1 for this, I'm in the same situation :(

maxowy commented 4 years ago

If you want to show up cached images immediately, and show loader on newly images, you can use a temporary hack until it will be improved:

InitialState: isLoading: false

onProgress //set isLoading to true
onLoadEnd //set isLoading to false