Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tkh44/react-localforage
👨🌾 Declarative localForage in React
https://github.com/tkh44/react-localforage
Last synced: 3 months ago
JSON representation
👨🌾 Declarative localForage in React
- Host: GitHub
- URL: https://github.com/tkh44/react-localforage
- Owner: tkh44
- License: mit
- Created: 2017-08-18T19:01:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-27T17:19:17.000Z (over 7 years ago)
- Last Synced: 2024-10-14T07:50:02.548Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 54
- Watchers: 3
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-render-props - react-localforage
- awesome-react-render-props - react-localforage
README
# react-localforage
Declarative [localForage](https://github.com/localForage/localForage) in React[![npm version](https://badge.fury.io/js/react-localforage.svg)](https://badge.fury.io/js/react-localforage)
[![Build Status](https://travis-ci.org/tkh44/react-localforage.svg?branch=master)](https://travis-ci.org/tkh44/react-localforage)
[![codecov](https://codecov.io/gh/tkh44/react-localforage/branch/master/graph/badge.svg)](https://codecov.io/gh/tkh44/react-localforage)- [Install](#install)
- [Forage.GetItem](#foragegetitem)
- [Forage.SetItem](#foragesetitem)## Install
```bash
npm install -S react-localforage
``````javascript
import Forage from 'react-localforage'
```## API
### `Forage.GetItem`
```jsx
{
return (
{error &&
}
{error.message}
{inProgress && }
{value &&
{JSON.stringify(value, null, 2)}}
)
}}
/>
```### `Forage.SetItem`
```jsx
{
return (
{error &&
}
{error.message}
{inProgress && }
{value &&
}
{value}
)
}}
/>
```