Nutritious Pomegranate Muffins

    slak-listview

    1.0.2 • Public • Published

    slak-listview

    A unidirectional virtual-dom list view. Renders a list of items to hyperscript.

    List items are passed a event emitter. Listeners can wait for events and take whatever action is needed (e.g. rerender the list, play a sound, start a program, etc...)

    Import

    //Import the module.
    //
    var ListView      = require('slak-listview');

    Construct

     
    //The itemToTree function converts javascript "item" objects users provide to hyperscript trees
    //  i.e. { type: 'mydata', ... } -> h('div', [myDataComponents, ...])
     
    //Constructs an empty ListView with no name, no message and add/remove buttons
    var view          = require('./view');
    var elementsView = ListView.ListView([], view.itemToTree, '', '', true, true);

    Render

    //Renders elementsView 
    var tree = ListView.render(elementsView);

    Install

    npm i slak-listview

    DownloadsWeekly Downloads

    1

    Version

    1.0.2

    License

    BSD3

    Last publish

    Collaborators

    • lakowske