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

Live updating leveldb list component for preact

Notifications You must be signed in to change notification settings

juliangruber/preact-level-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Live updating leveldb list component for preact

Resources

Stars

Watchers

Forks

Packages

No packages published