1.0.0 • Published 7 years ago

react-level-value v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

react-level-value

Live updating leveldb value component for react!

Example

import React from 'react'
import level from 'level'
import { Value } from 'react-level-value'

const db = level('/tmp/react-level-value')

class Example extends React.Component {
  render () {
    return (
      <div>
        Live value: <Value db={db} levelKey="key" />
      </div>
    )
  }
}

Now the <Value /> component will always reflect the value you have stored in your database at key.

Find a full example in /example:

$ npm install
$ npm run rebuild
$ npm start

screenshot

Installation

$ npm install react-level-value

API

<Value db levelKey />

License

MIT