JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 46
  • Score
    100M100P100Q65844F
  • License ISC

Package Exports

  • selection-manager

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (selection-manager) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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'})