0.0.5 • Published 8 years ago
@nathanfaucett/immutable-set v0.0.5
Immutable Set
Immutable persistent set for the browser and node.js
Install using npm
$ npm install @nathanfaucett/immutable-set --saveInstall using yarn
$ yarn add @nathanfaucett/immutable-set --saveExample Usage
var ImmutableSet = require("@nathanfaucett/immutable-set");;
var a = new ImmutableSet([0, 1]),
b = new ImmutableSet(0, 1),
c = ImmutableSet.of([0, 1]),
d = ImmutableSet.of(0, 1);
var a0 = a.set(2),
a1 = a.remove(1);Docs
Members
length -> Number
returns size of Set, only available if Object.defineProperty is supportedStatic Functions
Set.isSet(value: Any) -> Boolean
returns true if value is a set else falseSet.of(...values: Array) -> Set
creates Set from passed values same as new Set(...values: Array<Any>)Set.equal(a: Set, b: Set) -> Boolean
compares sets by valuesFunctions
size() -> Number
returns size of Setget(value: Any) -> Any
returns valuehas(value: Any) -> Boolean
returns true if set contains valueset(...values: Array) -> Set
returns new Set if value is not in Setremove(...values: Array) -> Set
returns new Set without the valueiterator(reverse = false: Boolean) -> Iterator
returns IteratortoArray() -> Array
returns Set elements in an Arrayjoin(separator = " ") -> String
join all elements of an Set into a StringtoString() -> String
String representation of Setequals(other: Set) -> Boolean
compares this set to other set by valuesevery, filter, forEach, forEachRight, set, reduce, reduceRight, some
common Array methods