npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

react-level-list

1.1.0

@juliangruber

npmHomeRepoSnykSocket
Downloads:17
$ npm install react-level-list
DailyWeeklyMonthlyYearly

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