@@ -224,14 +224,18 @@ Use this method if you need to download a file to the local filesystem prior to
224
224
``` js
225
225
import imageCacheHoc from ' react-native-image-cache-hoc' ;
226
226
const CacheableImage = imageCacheHoc (Image);
227
- CacheableImage .cacheFile (' https://i.redd.it/17ymhqwgbswz.jpg' );
228
-
229
- // The https://i.redd.it/17ymhqwgbswz.jpg remote file is now saved to local fs.
230
- // Since permanent was not set, this file is subject to cache pruning.
231
-
232
- CacheableImage .cacheFile (' https://i.redd.it/hhhim0kc5swz.jpg' , true );
233
-
234
- // The https://i.redd.it/hhhim0kc5swz.jpg remote file is now saved to local fs permanently.
227
+ CacheableImage .cacheFile (' https://i.redd.it/17ymhqwgbswz.jpg' )
228
+ .then ( localFileInfo => {
229
+ console .log (localFileInfo);
230
+ // The https://i.redd.it/17ymhqwgbswz.jpg remote file is now saved to local fs.
231
+ // Since permanent was not set, this file is subject to cache pruning.
232
+ });
233
+
234
+ CacheableImage .cacheFile (' https://i.redd.it/hhhim0kc5swz.jpg' , true )
235
+ .then ( localFileInfo => {
236
+ console .log (localFileInfo);
237
+ // The https://i.redd.it/hhhim0kc5swz.jpg remote file is now saved to local fs permanently.
238
+ });
235
239
```
236
240
237
241
** CacheableImage.flush()**
@@ -241,10 +245,12 @@ Delete all locally stored image files created by react-native-image-cache-hoc (c
241
245
``` js
242
246
import imageCacheHoc from ' react-native-image-cache-hoc' ;
243
247
const CacheableImage = imageCacheHoc (Image);
244
- CacheableImage .flush ();
245
-
246
- // All local filles created by 'react-native-image-cache-hoc' are now destroyed.
247
- // They will be rebuilt by future <CacheableImage> renders.
248
+ CacheableImage .flush ()
249
+ .then ( flushResults => {
250
+ console .log (flushResults);
251
+ // All local filles created by 'react-native-image-cache-hoc' are now destroyed.
252
+ // They will be rebuilt by future <CacheableImage> renders.
253
+ });
248
254
```
249
255
250
256
## Jest Test Support
0 commit comments