0.0.4 • Published 4 years ago

react-native-cache-storage v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Cache Storage

coverage pipeline

Cache Storage is a key value storage build on top of AsyncStorage, it uses a combination of memory and AsyncStorage to provide fast responses.

Usage

import CacheStorage from 'react-native-cache-storage';

const cacheStorage = new CacheStorage();

setItem

setItem(key: string, value: string, ttl?: number): Promise<void>;
  • ttl:
    • in seconds
    • default: 300
    • if 0 is informed item will never expire.

getItem

getItem(key: string): Promise<string | null>;

multiSet

multiSet(keyValuePairs: string[][], ttl: number = 300): Promise<void>;

clear

Remove all keys saved in CacheStorage.

clear(): Promise<void>;

Only affect keys saved by CacheStorage

0.0.4

4 years ago

0.0.4-alpha.2

5 years ago

0.0.4-alpha.1

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago