0.5.0 • Published 3 years ago

react-native-web-cache v0.5.0

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

react-native-web-cache

Build Status Coverage Status

Installation

NPM

npm install --save react-native-web-cache

Yarn

yarn add react-native-web-cache

Bower

bower install --save react-native-web-cache

Usage

JavaScript

var webCache = require("react-native-web-cache");
var cacheOptions = { capacity: 10 };
var cache = new webCache.Cache(cacheOptions);

async function() {
  await cache.setAsync("key", 42);
  var value = await cache.getAsync("key"); // value = 42
}

TypeScript

import { Cache, ICache, ICacheOptions } from "react-native-web-cache";
const cacheOptions: ICacheOptions = { capacity: 10 };
const cache: ICache = new Cache(cacheOptions);

const asyncFunction = async (): Promise<void> => {
  cache.setAsync<number>("key", 42).then((): void => {
    cache.getAsync<number>("key").then((value: number): number => value); // value = 42
  });
};
0.5.0

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago