react-native-fast-image icon indicating copy to clipboard operation
react-native-fast-image copied to clipboard

Detect if image is in cache

Open cmmartin opened this issue 7 years ago • 7 comments

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

cmmartin avatar Sep 18 '18 21:09 cmmartin

+1 I'm currently looking for this same solution

chadmg avatar Oct 15 '18 03:10 chadmg

+1 I was here for the same use case !

DavoCg avatar Oct 18 '18 16:10 DavoCg

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

n1ru4l avatar Oct 29 '18 07:10 n1ru4l

Please check #351

compojoom avatar Nov 23 '18 10:11 compojoom

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

nathantqn avatar Apr 10 '20 04:04 nathantqn

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

maxowy avatar Apr 10 '20 11:04 maxowy

onProgress is not getting called even for heavy URL images. Any idea why onProgress wont be called? Am doing some thing like this <D11Image source={imageSource} onLoadEnd={() => { console.log('onLoadEnd') }} onProgress={({nativeEvent}) => { console.log('OnProgress', nativeEvent?.loaded, nativeEvent?.total) }} />

ManushivamD11 avatar Mar 25 '25 06:03 ManushivamD11