1.0.0 • Published 7 years ago

preact-level-list v1.0.0

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

preact-level-list

Live updating leveldb list component for preact!

Example

import { h, render, Component } from 'preact'
import level from 'level'
import { List } from 'preact-level-list'

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

class Example extends Component {
  render () {
    return (
      <ul id="example">
        <List
          db={db}
          prefix='prefix'
          renderRow={ ({ value }) => <li>{value}</li> }
        />
      </div>
    )
  }
}

Now the <List /> component will always reflect the values you have stored in your database with prefix.

Find a full example in /example:

$ npm install
$ npm run rebuild
$ npm start

screenshot

Installation

$ npm install preact-level-list

API

<List db prefix renderRow />

License

MIT

1.0.0

7 years ago