Live updating leveldb list component for preact!
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
$ npm install preact-level-list
MIT