Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

juliangruber/preact-level-value

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

preact-level-value

Live updating leveldb value component for preact!

Example

import { h, render, Component } from 'preact'
import level from 'level'
import { Value } from 'preact-level-value'

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

class Example extends Component {
  render () {
    return <div id="example">
        Live value: <strong><Value db={db} key="key" /></strong>
      </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 preact-level-value

API

<Value db key />

License

MIT

About

Live updating leveldb value component for preact

Resources

Stars

Watchers

Forks

Packages

No packages published