candlefinance / cache

A key/value store for React Native

Home Page:https://candle.fi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool



Cache store for React Native

Screenshot 2024-05-01 at 12 27 12 AM

Using DiskCache for Android and non-deadlocking parallel PINCache for iOS, this library provides a simple interface to store data in a key-value format for offline mode.

Installation

  • Requires iOS 12+ for iOS
yarn add @candlefinance/cache
npm i @candlefinance/cache
  1. Add to your target in your Podfile if you get an error
pod 'PINCache', :modular_headers => true

Usage

Currently max size on iOS is 50MB and 200MB on Android.

await write('key', 'value');

const result = await read('key'); // can be undefined if key doesn't exist

await remove('key');

await clear();

Contributing

Join our Discord and ask questions in the #oss channel.

License

MIT

About

A key/value store for React Native

https://candle.fi

License:MIT License


Languages

Language:Ruby 20.3%Language:TypeScript 19.6%Language:Java 18.6%Language:JavaScript 15.4%Language:Objective-C 12.0%Language:Objective-C++ 7.2%Language:Swift 6.4%Language:C 0.5%