@jpgpereira/capacitor-image-cache
TypeScript icon, indicating that this package has built-in type declarations

0.0.13 • Public • Published

Image Cache Core

npm npm Build Status

npm i capacitor-image-cache

import { ImageCache } from 'capacitor-image-cache';

const cache = new ImageCache();

const { value } = await cache.get({src:"someSrc"}) // checks if the image is in cache and returns the image if not download, store then return

const { value } = await cache.clear() // Clear entire cache returns a boolean

const { value } = await cache.clearItem({src:"someSrc"}) // Clear item cache returns a boolean

const { value } = await cache.hasItem({src:"someSrc"}) // check if cache has item returns a boolean

Cached Image

npm npm Build Status

Cached Image

Install

Capacitor Image Cache is require for this package

  • npm i capacitor-image-cache st-cached-image

Usage

<st-cached-image src="https://i.annihil.us/u/prod/marvel/i/mg/e/e0/537bafa34baa9.jpg"></st-cached-image>

If using with ionic

import 'st-cached-image/dist/cached-image';

Update the following file since ionic ignores the file

youAppDir/node_modules/@ionic/app-scripts/config/copy.config.js

copyStCachedImage: {
    src: ['{{ROOT}}/node_modules/st-cached-image/dist/cached-image**/*'],
    dest: '{{BUILD}}'
  }

Readme

Keywords

Package Sidebar

Install

npm i @jpgpereira/capacitor-image-cache

Weekly Downloads

1

Version

0.0.13

License

MIT

Unpacked Size

160 kB

Total Files

54

Last publish

Collaborators

  • jpgpereira