Magic Lists
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