File caching
npm install react-native-filecachereact-native file caching helper.
* Caching remote files.
* Manage caches you created.
``js`
import FileCache from 'react-native-filecache'
`js`
const response = await FileCache.fetch(uri)
const blob = response.blob('image/png')
const text = response.text()
`js`
const cacheObj = await FileCache.cache(uri)
// { id: 'cache_id_as_string', path: '/absolute/path/to_native_cached_file' }
console.log(cacheObj)
`js`
const cacheObj = await FileCache.cache(uri, 'tag-1')
// { tag: 'tag-1', id: 'cache_id_as_string', path: '/absolute/path/to_native_cached_file' }
console.log(cacheObj)
`js`
await FileCache.clearAll()
`js`
await FileCache.clear(cacheObj)
`js`
await FileCache.clearTagged('tag-1')
`sh``install
npm install react-native-filecachelink in your project
react-native link react-native-filecache
* Cache with tag.
* Remove tagged caches at once.
Yusuke Shibata
MIT