@mutagen-d/react-native-image-cache
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

React Native Image Cache

Caching images to disk

Installation

This package depends on rn-fetch-blob. First install it

npm i @mutagen-d/react-native-image-cache
// or
yarn add @mutagen-d/react-native-image-cache

Usage

ImageCache inherits all methods of RNFileCache from @mutagen-d/react-native-file-cache

import React, { useEffect } from 'react'
import ImageCache from '@mutagen-d/react-native-image-cache'

const App = () => {
  useEffect(() => {
    const load = async () => {
      await ImageCache.load()
    }
    load()
  }, [])
  return <ImageCache
    source={{
      uri: 'https://example.com/image.png',
      headers: { Authorization: 'Bearer <token>' },
    }}
  />
}

Package Sidebar

Install

npm i @mutagen-d/react-native-image-cache

Weekly Downloads

0

Version

0.2.0

License

ISC

Unpacked Size

18.1 kB

Total Files

7

Last publish

Collaborators

  • mutagen-d