Home

Awesome

React Native Cache Store npm version

A localStorage-like wrapper around React Native's AsyncStorage with cache expiration.

100% inspired by @pamelafox's lscache. Currently being used by my project, hackerweb-ios.

WARNING: The test coverage is not very high 😅

Installation

npm i --save react-native-cache-store

API Reference

Example Usage

import CacheStore from 'react-native-cache-store';

CacheStore.set('key', 'value', 10); // Expires in 10 minutes

CacheStore.get('key').then((value) => {
  // Do something with value
});

CacheStore.isExpired('key')
  .then(() => {/* true */ })
  .catch(() => {/* false */})

Contribute

Of course, contributions welcomed! 🙌

License

MIT.