# react-native-web-cache

> An LRU cache built with React Native in mind

Latest version **0.5.0** (published 2020-12-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-web-cache
pnpm add react-native-web-cache
yarn add react-native-web-cache
bun add react-native-web-cache
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2020-12-01 |
| First published | 2020-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 25.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Hayden Phothong |
| Maintainers | hphothong |
| Keywords | react, react-native, cache, context, request |

## Links

- npm: https://www.npmjs.com/package/react-native-web-cache
- Repository: https://github.com/hphothong/react-native-web-cache
- Homepage: https://github.com/hphothong/react-native-web-cache#readme
- Issues: https://github.com/hphothong/react-native-web-cache/issues
- npm.io page: https://npm.io/package/react-native-web-cache

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.5.0 (latest) — 2020-12-01
- 0.4.0 — 2020-12-01
- 0.3.0 — 2020-11-30
- 0.2.0 — 2020-11-26
- 0.1.2 — 2020-11-25
- 0.1.1 — 2020-11-25

## README

# react-native-web-cache

[![Build Status](https://travis-ci.com/hphothong/react-native-web-cache.svg?branch=main)](https://travis-ci.com/hphothong/react-native-web-cache)
[![Coverage Status](https://coveralls.io/repos/github/hphothong/react-native-web-cache/badge.svg?branch=main)](https://coveralls.io/github/hphothong/react-native-web-cache?branch=main)

## Installation

### NPM

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

### Yarn

```sh
yarn add react-native-web-cache
```

### Bower

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

## Usage

### JavaScript

```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

```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
  });
};
```

---
_Source: https://npm.io/package/react-native-web-cache · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
