0.1.2 • Published 8 years ago

magic-lists v0.1.2

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

Magic Lists

NPM

Build Status js-standard-style npm.io

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