npm.io
0.1.2 • Published 10 years ago

magic-lists

Licence
ISC
Version
0.1.2
Deps
3
Vulns
0
Weekly
0

Magic Lists

NPM

Build Status js-standard-style

Magic lists is a small library for special lists.

Setup

First install the library

npm install magic-lists

Then include it in your project

const MagicLists = require('magic-lists')

Types of Lists

Sorted List

A list whose contents are always filtered.

const SortedList = MagicLists.sortedList
let sorted = new SortedList()
sorted.push(7)
sorted.push(3)
sorted.push(6)
sorted.get() //[3, 6, 7]
Notes

sorted takes two optional arguments

  • The first being an array for initial value
  • A function to override the default sorting function