Live updating leveldb list component for react!
import React from 'react'
import level from 'level'
import { List } from 'react-level-list'
const db = level('/tmp/react-level-list')
class Example extends React.Component {
render () {
return (
<ul id="example">
<List
db={db}
prefix='prefix'
renderRow={ ({ value }) => <li>{value}</li> }
filter=({ value } => Number(value) > 0.5)
/>
</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 react-level-list
MIT