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 react

Notifications You must be signed in to change notification settings

juliangruber/react-level-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-level-list

Live updating leveldb list component for react!

Example

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

screenshot

Installation

$ npm install react-level-list

API

<List db [prefix renderRow filter] />

License

MIT

About

Live updating leveldb list component for react

Resources

Stars

Watchers

Forks

Packages

No packages published