selection-manager

1.0.31 • Public • Published

selection-manager

Single Selection and Multi Selection handler for JavaScript objects, each object is expected to have unique id attribute defined

Usage

 
 
var Selection = require('selection-manager');
 
var singleSelect = new Selection();
singleSelect.on('change', function(selected, prevSelected){
    console.log(selected);
})
singleSelect.select({id:1, name:'name1'})
 
 
 
var multiSelect = new Selection({multiSelect:true});
 
multiSelect.on('change', function(selected, prevSelected){
    console.log(selected);
})
 
 
multiSelect.select({id:1, name:'name1'})
multiSelect.select({id:2, name:'name2'})
 
 

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i selection-manager

    Weekly Downloads

    73

    Version

    1.0.31

    License

    ISC

    Unpacked Size

    27.9 kB

    Total Files

    14

    Last publish

    Collaborators

    • ravi.hamsa
    • ravihamsa