Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

list-editor

2.0.0 • Public • Published

list-editor

A virtual-dom element for editing a small list of items. The list can be an array or flat object.

npm

Example

var raf = require('virtual-raf')
var listEditor = require('list-editor')
 
function render (state) {
  function removeItem (e, items) {
    state.items = items
    tree.update(state)
  }
 
  function onsubmit (e, items, item) {
    state.items = items
    tree.update(state)
  }
 
  function oninput (e, value) {}
 
  state.removeItem = removeItem
  state.onsubmit = onsubmit
  state.oninput = oninput
 
  return listEditor(h, state)
}
 
var tree = raf({ items: {}, keys: true }, render, require('virtual-dom'))
document.body.appendChild(tree())

License

MIT

Keywords

none

install

npm i list-editor

Downloadsweekly downloads

1

version

2.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability