All Projects → tkh44 → react-localforage

tkh44 / react-localforage

Licence: MIT license
👨‍🌾 Declarative localForage in React

Programming Languages

javascript
184084 projects - #8 most used programming language

react-localforage

Declarative localForage in React

npm version Build Status codecov

Install

npm install -S react-localforage
import Forage from 'react-localforage'

API

Forage.GetItem

<Forage.GetItem
  itemKey='auth-token'
  render={({inProgress, value, error}) => {
    return (
      <div>
        {error &&
        <div>
          {error.message}
        </div>}
        {inProgress && <progress/>}
        {value &&
         <pre>{JSON.stringify(value, null, 2)}</pre>}
      </div>
    )
  }}
/>

Forage.SetItem

<Forage.SetItem
  itemKey='auth-token'
  itemValue={authToken}
  render={({inProgress, value, error}) => {
    return (
      <div>
        {error &&
        <div>
          {error.message}
        </div>}
        {inProgress && <progress/>}
        {value &&
        <div>
          {value}
        </div>}
      </div>
    )
  }}
/>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].