LBear
A simple collections library based on ES6.
Installation
npm i lbear
Usage
Immutable Map
import { ImMap } from 'lbear/map'
const map = ImMap.of({ a: 1, b: 2, c: 3 })
for (const [k, v] of map) {
console.log(`${k} => ${v}`)
}
Option
import { Option } from 'lbear/option'
const value = Option.some(1)
const empty = Option.none()
Seq
import { Seq } from 'lbear/seq'
const seq = Seq.of(1, 2, 3)
const odd = seq.filter(x => x % 2 == 1)
const arr = odd.toArray()
License
MIT License © 2021 XLor