Immutable.js Flashcards
List
Create a new immutable _____ containing the values of the provided iterable-like.
\_\_\_\_\_<T>():\_\_\_\_\_<T>\_\_\_\_\_<T>(iter: IndexedIterable<T>):\_\_\_\_\_<T>\_\_\_\_\_<T>(iter: SetIterable<T>):\_\_\_\_\_<T>\_\_\_\_\_<K, V>(iter: KeyedIterable<K, V>):\_\_\_\_\_<any>\_\_\_\_\_<T>(array: Array<T>):\_\_\_\_\_<T>\_\_\_\_\_<T>(iterator: Iterator<T>):\_\_\_\_\_<T>\_\_\_\_\_<T>(iterable: Object):\_\_\_\_\_<T>
1 construction methods.
List
Create a new immutable List containing the values of the provided iterable-like.
List<T>(): List<T>List<T>(iter: IndexedIterable<T>): List<T>List<T>(iter: SetIterable<T>): List<T>List<K, V>(iter: KeyedIterable<K, V>): List<any>List<T>(array: Array<T>): List<T>List<T>(iterator: Iterator<T>): List<T>List<T>(iterable: Object): List<T>
List
True if the provided value is a List
List.isList(maybeList: any): boolean
2 static methods methods.
List.isList
True if the provided value is a List
List.isList(maybeList: any): boolean
List
Creates a new List containing values
.
List.of<T>(...values: T[]): List<T>
2 static methods methods.
List.of
Creates a new List containing values
.
List.of<T>(...values: T[]): List<T>
List
Returns a new List which includes value
at index
. If index
already exists in this List, it will be replaced.
\_\_\_\_\_(index: number, value: T): List<T>
13 persistent changes methods.
set
Returns a new List which includes value
at index
. If index
already exists in this List, it will be replaced.
set(index: number, value: T): List<T>
List
Returns a new List which excludes this index
and with a size 1 less than this List. Values at indicies above index
are shifted down by 1 to fill the position.
\_\_\_\_\_(index: number): List<T>
13 persistent changes methods.
delete
Returns a new List which excludes this index
and with a size 1 less than this List. Values at indicies above index
are shifted down by 1 to fill the position.
delete(index: number): List<T>
List
Returns a new List with 0 size and no values.
\_\_\_\_\_(): List<T>
13 persistent changes methods.
clear
Returns a new List with 0 size and no values.
clear(): List<T>
List
Returns a new List with the provided values
appended, starting at this List’s size
.
\_\_\_\_\_(...values: T[]): List<T>
13 persistent changes methods.
push
Returns a new List with the provided values
appended, starting at this List’s size
.
push(...values: T[]): List<T>
List
Returns a new List with a size ones less than this List, excluding the last index in this List.
\_\_\_\_\_(): List<T>
13 persistent changes methods.
pop
Returns a new List with a size ones less than this List, excluding the last index in this List.
pop(): List<T>
List
Returns a new List with the provided values
prepended, shifting other values ahead to higher indices.
\_\_\_\_\_(...values: T[]): List<T>
13 persistent changes methods.
unshift
Returns a new List with the provided values
prepended, shifting other values ahead to higher indices.
unshift(...values: T[]): List<T>
List
Returns a new List with a size ones less than this List, excluding the first index in this List, _____ing all other values to a lower index.
\_\_\_\_\_(): List<T>
13 persistent changes methods.
shift
Returns a new List with a size ones less than this List, excluding the first index in this List, shifting all other values to a lower index.
shift(): List<T>
List
Returns a new List with an _____d value at index
with the return value of calling \_\_\_\_\_r
with the existing value, or notSetValue
if index
was not set. If called with a single argument, \_\_\_\_\_r
is called with the List itself.
\_\_\_\_\_(\_\_\_\_\_r: (value: List<T>) => List<T>): List<T>\_\_\_\_\_(index: number,\_\_\_\_\_r: (value: T) => T): List<T>\_\_\_\_\_(index: number, notSetValue: T,\_\_\_\_\_r: (value: T) => T): List<T>
13 persistent changes methods.
update
Returns a new List with an updated value at index
with the return value of calling updater
with the existing value, or notSetValue
if index
was not set. If called with a single argument, updater
is called with the List itself.
update(updater: (value: List<T>) => List<T>): List<T>update(index: number, updater: (value: T) => T): List<T>update(index: number, notSetValue: T, updater: (value: T) => T): List<T>
List\_\_\_\_\_(...iterables: IndexedIterable<T>[]): List<T>\_\_\_\_\_(...iterables: Array<T>[]): List<T>
13 persistent changes methods.
mergemerge(...iterables: IndexedIterable<T>[]): List<T>merge(...iterables: Array<T>[]): List<T>
List
`_____(
merger: (previous?: T, next?: T, key?: number) => T,…iterables: IndexedIterable<T>[]</T>
): List<T>\_\_\_\_\_(
merger: (previous?: T, next?: T, key?: number) => T,...iterables: Array<T>[]</T></T>
): List<T>`</T>
13 persistent changes methods.
mergeWith
`mergeWith(
merger: (previous?: T, next?: T, key?: number) => T,…iterables: IndexedIterable<T>[]</T>
): List<T>mergeWith(
merger: (previous?: T, next?: T, key?: number) => T,...iterables: Array<T>[]</T></T>
): List<T>`</T>
List\_\_\_\_\_(...iterables: IndexedIterable<T>[]): List<T>\_\_\_\_\_(...iterables: Array<T>[]): List<T>
13 persistent changes methods.
mergeDeepmergeDeep(...iterables: IndexedIterable<T>[]): List<T>mergeDeep(...iterables: Array<T>[]): List<T>
List
`_____(
merger: (previous?: T, next?: T, key?: number) => T,…iterables: IndexedIterable<T>[]</T>
): List<T>\_\_\_\_\_(
merger: (previous?: T, next?: T, key?: number) => T,...iterables: Array<T>[]</T></T>
): List<T>`</T>
13 persistent changes methods.
mergeDeepWith
`mergeDeepWith(
merger: (previous?: T, next?: T, key?: number) => T,…iterables: IndexedIterable<T>[]</T>
): List<T>mergeDeepWith(
merger: (previous?: T, next?: T, key?: number) => T,...iterables: Array<T>[]</T></T>
): List<T>`</T>
List
Returns a new List with size size
. If size
is less than this List’s size, the new List will exclude values at the higher indices. If size
is greater than this List’s size, the new List will have undefined values for the newly available indices.
\_\_\_\_\_(size: number): List<T>
13 persistent changes methods.
setSize
Returns a new List with size size
. If size
is less than this List’s size, the new List will exclude values at the higher indices. If size
is greater than this List’s size, the new List will have undefined values for the newly available indices.
setSize(size: number): List<T>
List
Returns a new List having set value
at this keyPath
. If any keys in keyPath
do not exist, a new immutable Map will be created at that key.
\_\_\_\_\_(keyPath: Array<any>, value: any): List<T>\_\_\_\_\_(keyPath: Iterable<any, any>, value: any): List<T>
5 deep persistent changes methods.
setIn
Returns a new List having set value
at this keyPath
. If any keys in keyPath
do not exist, a new immutable Map will be created at that key.
setIn(keyPath: Array<any>, value: any): List<T>setIn(keyPath: Iterable<any, any>, value: any): List<T>
List
Returns a new List having removed the value at this keyPath
. If any keys in keyPath
do not exist, no change will occur.
\_\_\_\_\_(keyPath: Array<any>): List<T>\_\_\_\_\_(keyPath: Iterable<any, any>): List<T>
5 deep persistent changes methods.
deleteIn
Returns a new List having removed the value at this keyPath
. If any keys in keyPath
do not exist, no change will occur.
deleteIn(keyPath: Array<any>): List<T>deleteIn(keyPath: Iterable<any, any>): List<T>
List
`_____(keyPath: Array<any>, updater: (value: any) => any): List<T>\_\_\_\_\_(
keyPath: Array<any>,notSetValue: any,updater: (value: any) => any</any></T></any>
): List<T>\_\_\_\_\_(keyPath: Iterable<any, any>, updater: (value: any) => any): List<T>\_\_\_\_\_(
keyPath: Iterable<any, any>,notSetValue: any,updater: (value: any) => any</T></T>
): List<T>`</T>
5 deep persistent changes methods.
updateIn
`updateIn(keyPath: Array<any>, updater: (value: any) => any): List<T>updateIn(
keyPath: Array<any>,notSetValue: any,updater: (value: any) => any</any></T></any>
): List<T>updateIn(keyPath: Iterable<any, any>, updater: (value: any) => any): List<T>updateIn(
keyPath: Iterable<any, any>,notSetValue: any,updater: (value: any) => any</T></T>
): List<T>`</T>
List
`_____(
keyPath: Iterable<any, any>,…iterables: IndexedIterable<T>[]</T>
): List<T>\_\_\_\_\_(keyPath: Array<any>, ...iterables: IndexedIterable<T>[]): List<T>\_\_\_\_\_(keyPath: Array<any>, ...iterables: Array<T>[]): List<T>`</T></T></any></T></T></any></T>
5 deep persistent changes methods.
mergeIn
`mergeIn(
keyPath: Iterable<any, any>,…iterables: IndexedIterable<T>[]</T>
): List<T>mergeIn(keyPath: Array<any>, ...iterables: IndexedIterable<T>[]): List<T>mergeIn(keyPath: Array<any>, ...iterables: Array<T>[]): List<T>`</T></T></any></T></T></any></T>
List
`_____(
keyPath: Iterable<any, any>,…iterables: IndexedIterable<T>[]</T>
): List<T>\_\_\_\_\_(keyPath: Array<any>, ...iterables: IndexedIterable<T>[]): List<T>\_\_\_\_\_(keyPath: Array<any>, ...iterables: Array<T>[]): List<T>`</T></T></any></T></T></any></T>
5 deep persistent changes methods.
mergeDeepIn
`mergeDeepIn(
keyPath: Iterable<any, any>,…iterables: IndexedIterable<T>[]</T>
): List<T>mergeDeepIn(keyPath: Array<any>, ...iterables: IndexedIterable<T>[]): List<T>mergeDeepIn(keyPath: Array<any>, ...iterables: Array<T>[]): List<T>`</T></T></any></T></T></any></T>
List
Note: Not all methods can be used on a mutable collection or within \_\_\_\_\_
! Only set
, push
, pop
, shift
, unshift
and merge
may be used mutatively.
\_\_\_\_\_(mutator: (mutable: List<T>) => any): List<T>
3 transient changes methods.
withMutations
Note: Not all methods can be used on a mutable collection or within withMutations
! Only set
, push
, pop
, shift
, unshift
and merge
may be used mutatively.
withMutations(mutator: (mutable: List<T>) => any): List<T>
List\_\_\_\_\_(): List<T>
3 transient changes methods.
asMutableasMutable(): List<T>
List\_\_\_\_\_(): List<T>
3 transient changes methods.
asImmutableasImmutable(): List<T>
Map
Creates a new Immutable _____.
\_\_\_\_\_<K, V>():\_\_\_\_\_<K, V>\_\_\_\_\_<K, V>(iter: KeyedIterable<K, V>):\_\_\_\_\_<K, V>\_\_\_\_\_<K, V>(iter: Iterable<any, Array<any>>):\_\_\_\_\_<K, V>\_\_\_\_\_<K, V>(array: Array<Array<any>>):\_\_\_\_\_<K, V>\_\_\_\_\_<V>(obj: {[key: string]: V}):\_\_\_\_\_<string, V>\_\_\_\_\_<K, V>(iterator: Iterator<Array<any>>):\_\_\_\_\_<K, V>\_\_\_\_\_<K, V>(iterable: Object):\_\_\_\_\_<K, V>
1 construction methods.
Map
Creates a new Immutable Map.
Map<K, V>(): Map<K, V>Map<K, V>(iter: KeyedIterable<K, V>): Map<K, V>Map<K, V>(iter: Iterable<any, Array<any>>): Map<K, V>Map<K, V>(array: Array<Array<any>>): Map<K, V>Map<V>(obj: {[key: string]: V}): Map<string, V>Map<K, V>(iterator: Iterator<Array<any>>): Map<K, V>Map<K, V>(iterable: Object): Map<K, V>
Map
True if the provided value is a Map
Map.isMap(maybeMap: any): boolean
1 static methods methods.
Map.isMap
True if the provided value is a Map
Map.isMap(maybeMap: any): boolean
Map
Returns a new Map also containing the new key, value pair. If an equivalent key already exists in this Map, it will be replaced.
\_\_\_\_\_(key: K, value: V): Map<K, V>
8 persistent changes methods.
set
Returns a new Map also containing the new key, value pair. If an equivalent key already exists in this Map, it will be replaced.
set(key: K, value: V): Map<K, V>
Map
Returns a new Map which excludes this key
.
\_\_\_\_\_(key: K): Map<K, V>
8 persistent changes methods.
delete
Returns a new Map which excludes this key
.
delete(key: K): Map<K, V>
Map
Returns a new Map containing no keys or values.
\_\_\_\_\_(): Map<K, V>
8 persistent changes methods.
clear
Returns a new Map containing no keys or values.
clear(): Map<K, V>
Map
Returns a new Map having _____d the value at this key
with the return value of calling \_\_\_\_\_r
with the existing value, or notSetValue
if the key was not set. If called with only a single argument, \_\_\_\_\_r
is called with the Map itself.
\_\_\_\_\_(\_\_\_\_\_r: (value: Map<K, V>) => Map<K, V>): Map<K, V>\_\_\_\_\_(key: K,\_\_\_\_\_r: (value: V) => V): Map<K, V>\_\_\_\_\_(key: K, notSetValue: V,\_\_\_\_\_r: (value: V) => V): Map<K, V>
8 persistent changes methods.
update
Returns a new Map having updated the value at this key
with the return value of calling updater
with the existing value, or notSetValue
if the key was not set. If called with only a single argument, updater
is called with the Map itself.
update(updater: (value: Map<K, V>) => Map<K, V>): Map<K, V>update(key: K, updater: (value: V) => V): Map<K, V>update(key: K, notSetValue: V, updater: (value: V) => V): Map<K, V>
Map
Returns a new Map resulting from merging the provided Iterables (or JS objects) into this Map. In other words, this takes each entry of each iterable and sets it on this Map.
\_\_\_\_\_(...iterables: Iterable<K, V>[]): Map<K, V>\_\_\_\_\_(...iterables: {[key: string]: V}[]): Map<string, V>
8 persistent changes methods.
merge
Returns a new Map resulting from merging the provided Iterables (or JS objects) into this Map. In other words, this takes each entry of each iterable and sets it on this Map.
merge(...iterables: Iterable<K, V>[]): Map<K, V>merge(...iterables: {[key: string]: V}[]): Map<string, V>
Map
Like merge()
, \_\_\_\_\_()
returns a new Map resulting from merging the provided Iterables (or JS objects) into this Map, but uses the merger
function for dealing with conflicts.
`_____(
merger: (previous?: V, next?: V, key?: K) => V,…iterables: Iterable<K, V>[]
): Map<K, V>_____(
merger: (previous?: V, next?: V, key?: K) => V,…iterables: {[key: string]: V}[]
): Map<string, V>`
8 persistent changes methods.
mergeWith
Like merge()
, mergeWith()
returns a new Map resulting from merging the provided Iterables (or JS objects) into this Map, but uses the merger
function for dealing with conflicts.
`mergeWith(
merger: (previous?: V, next?: V, key?: K) => V,…iterables: Iterable<K, V>[]
): Map<K, V>mergeWith(
merger: (previous?: V, next?: V, key?: K) => V,…iterables: {[key: string]: V}[]
): Map<string, V>`
Map
Like merge()
, but when two Iterables conflict, it merges them as well, recursing deeply through the nested data.
\_\_\_\_\_(...iterables: Iterable<K, V>[]): Map<K, V>\_\_\_\_\_(...iterables: {[key: string]: V}[]): Map<string, V>
8 persistent changes methods.
mergeDeep
Like merge()
, but when two Iterables conflict, it merges them as well, recursing deeply through the nested data.
mergeDeep(...iterables: Iterable<K, V>[]): Map<K, V>mergeDeep(...iterables: {[key: string]: V}[]): Map<string, V>
Map
Like mergeDeep()
, but when two non-Iterables conflict, it uses the merger
function to determine the resulting value.
`_____(
merger: (previous?: V, next?: V, key?: K) => V,…iterables: Iterable<K, V>[]
): Map<K, V>_____(
merger: (previous?: V, next?: V, key?: K) => V,…iterables: {[key: string]: V}[]
): Map<string, V>`
8 persistent changes methods.
mergeDeepWith
Like mergeDeep()
, but when two non-Iterables conflict, it uses the merger
function to determine the resulting value.
`mergeDeepWith(
merger: (previous?: V, next?: V, key?: K) => V,…iterables: Iterable<K, V>[]
): Map<K, V>mergeDeepWith(
merger: (previous?: V, next?: V, key?: K) => V,…iterables: {[key: string]: V}[]
): Map<string, V>`
Map
Returns a new Map having set value
at this keyPath
. If any keys in keyPath
do not exist, a new immutable Map will be created at that key.
\_\_\_\_\_(keyPath: Array<any>, value: any): Map<K, V>\_\_\_\_\_(KeyPath: Iterable<any, any>, value: any): Map<K, V>
5 deep persistent changes methods.
setIn
Returns a new Map having set value
at this keyPath
. If any keys in keyPath
do not exist, a new immutable Map will be created at that key.
setIn(keyPath: Array<any>, value: any): Map<K, V>setIn(KeyPath: Iterable<any, any>, value: any): Map<K, V>
Map
Returns a new Map having removed the value at this keyPath
. If any keys in keyPath
do not exist, no change will occur.
\_\_\_\_\_(keyPath: Array<any>): Map<K, V>\_\_\_\_\_(keyPath: Iterable<any, any>): Map<K, V>
5 deep persistent changes methods.
deleteIn
Returns a new Map having removed the value at this keyPath
. If any keys in keyPath
do not exist, no change will occur.
deleteIn(keyPath: Array<any>): Map<K, V>deleteIn(keyPath: Iterable<any, any>): Map<K, V>
Map
Returns a new Map having applied the updater
to the entry found at the keyPath.
`_____(keyPath: Array<any>, updater: (value: any) => any): Map<K, V>\_\_\_\_\_(
keyPath: Array<any>,notSetValue: any,updater: (value: any) => any</any></any>
): Map<K, V>_____(keyPath: Iterable<any, any>, updater: (value: any) => any): Map<K, V>_____(
keyPath: Iterable<any, any>,notSetValue: any,updater: (value: any) => any
): Map<K, V>`
5 deep persistent changes methods.
updateIn
Returns a new Map having applied the updater
to the entry found at the keyPath.
`updateIn(keyPath: Array<any>, updater: (value: any) => any): Map<K, V>updateIn(
keyPath: Array<any>,notSetValue: any,updater: (value: any) => any</any></any>
): Map<K, V>updateIn(keyPath: Iterable<any, any>, updater: (value: any) => any): Map<K, V>updateIn(
keyPath: Iterable<any, any>,notSetValue: any,updater: (value: any) => any
): Map<K, V>`
Map
A combination of updateIn
and merge
, returning a new Map, but performing the merge at a point arrived at by following the keyPath. In other words, these two lines are equivalent:
\_\_\_\_\_(keyPath: Iterable<any, any>, ...iterables: Iterable<K, V>[]): Map<K, V>\_\_\_\_\_(keyPath: Array<any>, ...iterables: Iterable<K, V>[]): Map<K, V>\_\_\_\_\_(keyPath: Array<any>, ...iterables: {[key: string]: V}[]): Map<string, V>
5 deep persistent changes methods.
mergeIn
A combination of updateIn
and merge
, returning a new Map, but performing the merge at a point arrived at by following the keyPath. In other words, these two lines are equivalent:
mergeIn(keyPath: Iterable<any, any>, ...iterables: Iterable<K, V>[]): Map<K, V>mergeIn(keyPath: Array<any>, ...iterables: Iterable<K, V>[]): Map<K, V>mergeIn(keyPath: Array<any>, ...iterables: {[key: string]: V}[]): Map<string, V>
Map
A combination of updateIn
and mergeDeep
, returning a new Map, but performing the deep merge at a point arrived at by following the keyPath. In other words, these two lines are equivalent:
`_____(
keyPath: Iterable<any, any>,…iterables: Iterable<K, V>[]
): Map<K, V>_____(keyPath: Array<any>, ...iterables: Iterable<K, V>[]): Map<K, V>\_\_\_\_\_(
keyPath: Array<any>,...iterables: {[key: string]: V}[]</any></any>
): Map<string, V>`
5 deep persistent changes methods.
mergeDeepIn
A combination of updateIn
and mergeDeep
, returning a new Map, but performing the deep merge at a point arrived at by following the keyPath. In other words, these two lines are equivalent:
`mergeDeepIn(
keyPath: Iterable<any, any>,…iterables: Iterable<K, V>[]
): Map<K, V>mergeDeepIn(keyPath: Array<any>, ...iterables: Iterable<K, V>[]): Map<K, V>mergeDeepIn(
keyPath: Array<any>,...iterables: {[key: string]: V}[]</any></any>
): Map<string, V>`
Map
Every time you call one of the above functions, a new immutable Map is created. If a pure function calls a number of these to produce a final return value, then a penalty on performance and memory has been paid by creating all of the intermediate immutable Maps.
\_\_\_\_\_(mutator: (mutable: Map<K, V>) => any): Map<K, V>
3 transient changes methods.
withMutations
Every time you call one of the above functions, a new immutable Map is created. If a pure function calls a number of these to produce a final return value, then a penalty on performance and memory has been paid by creating all of the intermediate immutable Maps.
withMutations(mutator: (mutable: Map<K, V>) => any): Map<K, V>
Map
Another way to avoid creation of intermediate Immutable maps is to create a mutable copy of this collection. Mutable copies always return this
, and thus shouldn’t be used for equality. Your function should never return a mutable copy of a collection, only use it internally to create a new collection. If possible, use withMutations
as it provides an easier to use API.
\_\_\_\_\_(): Map<K, V>
3 transient changes methods.
asMutable
Another way to avoid creation of intermediate Immutable maps is to create a mutable copy of this collection. Mutable copies always return this
, and thus shouldn’t be used for equality. Your function should never return a mutable copy of a collection, only use it internally to create a new collection. If possible, use withMutations
as it provides an easier to use API.
asMutable(): Map<K, V>
Map
The yin to asMutable
’s yang. Because it applies to mutable collections, this operation is mutable and returns itself. Once performed, the mutable copy has become immutable and can be safely returned from a function.
\_\_\_\_\_(): Map<K, V>
3 transient changes methods.
asImmutable
The yin to asMutable
’s yang. Because it applies to mutable collections, this operation is mutable and returns itself. Once performed, the mutable copy has become immutable and can be safely returned from a function.
asImmutable(): Map<K, V>
OrderedMap
Creates a new Immutable _____.
\_\_\_\_\_<K, V>():\_\_\_\_\_<K, V>\_\_\_\_\_<K, V>(iter: KeyedIterable<K, V>):\_\_\_\_\_<K, V>\_\_\_\_\_<K, V>(iter: Iterable<any, Array<any>>):\_\_\_\_\_<K, V>\_\_\_\_\_<K, V>(array: Array<Array<any>>):\_\_\_\_\_<K, V>\_\_\_\_\_<V>(obj: {[key: string]: V}):\_\_\_\_\_<string, V>\_\_\_\_\_<K, V>(iterator: Iterator<Array<any>>):\_\_\_\_\_<K, V>\_\_\_\_\_<K, V>(iterable: Object):\_\_\_\_\_<K, V>
1 construction methods.
OrderedMap
Creates a new Immutable OrderedMap.
OrderedMap<K, V>(): OrderedMap<K, V>OrderedMap<K, V>(iter: KeyedIterable<K, V>): OrderedMap<K, V>OrderedMap<K, V>(iter: Iterable<any, Array<any>>): OrderedMap<K, V>OrderedMap<K, V>(array: Array<Array<any>>): OrderedMap<K, V>OrderedMap<V>(obj: {[key: string]: V}): OrderedMap<string, V>OrderedMap<K, V>(iterator: Iterator<Array<any>>): OrderedMap<K, V>OrderedMap<K, V>(iterable: Object): OrderedMap<K, V>
OrderedMap
True if the provided value is an OrderedMap.
OrderedMap.isOrderedMap(maybeOrderedMap: any): boolean
1 static methods methods.
OrderedMap.isOrderedMap
True if the provided value is an OrderedMap.
OrderedMap.isOrderedMap(maybeOrderedMap: any): boolean
Set
Create a new immutable _____ containing the values of the provided iterable-like.
\_\_\_\_\_<T>():\_\_\_\_\_<T>\_\_\_\_\_<T>(iter:\_\_\_\_\_Iterable<T>): \_\_\_\_\_<T>\_\_\_\_\_<T>(iter: IndexedIterable<T>): \_\_\_\_\_<T>\_\_\_\_\_<K, V>(iter: KeyedIterable<K, V>): \_\_\_\_\_<any>\_\_\_\_\_<T>(array: Array<T>): \_\_\_\_\_<T>\_\_\_\_\_<T>(iterator: Iterator<T>): \_\_\_\_\_<T>\_\_\_\_\_<T>(iterable: Object): \_\_\_\_\_<T>
1 construction methods.
Set
Create a new immutable Set containing the values of the provided iterable-like.
Set<T>(): Set<T>Set<T>(iter: SetIterable<T>): Set<T>Set<T>(iter: IndexedIterable<T>): Set<T>Set<K, V>(iter: KeyedIterable<K, V>): Set<any>Set<T>(array: Array<T>): Set<T>Set<T>(iterator: Iterator<T>): Set<T>Set<T>(iterable: Object): Set<T>
Set
True if the provided value is a Set
Set.isSet(maybeSet: any): boolean
3 static methods methods.
Set.isSet
True if the provided value is a Set
Set.isSet(maybeSet: any): boolean
Set
Creates a new Set containing values
.
Set.of<T>(...values: T[]): Set<T>
3 static methods methods.
Set.of
Creates a new Set containing values
.
Set.of<T>(...values: T[]): Set<T>
Set
Set.fromKeys()
creates a new immutable Set containing the keys from this Iterable or JavaScript Object.
Set.fromKeys<T>(iter: Iterable<T, any>): Set<T>Set.fromKeys(obj: {[key: string]: any}): Set<string>
3 static methods methods.
Set.fromKeys
Set.fromKeys()
creates a new immutable Set containing the keys from this Iterable or JavaScript Object.
Set.fromKeys<T>(iter: Iterable<T, any>): Set<T>Set.fromKeys(obj: {[key: string]: any}): Set<string>
Set
Returns a new Set which also includes this value.
\_\_\_\_\_(value: T): Set<T>
6 persistent changes methods.
add
Returns a new Set which also includes this value.
add(value: T): Set<T>
Set
Returns a new Set which excludes this value.
\_\_\_\_\_(value: T): Set<T>
6 persistent changes methods.
delete
Returns a new Set which excludes this value.
delete(value: T): Set<T>
Set
Returns a new Set containing no values.
\_\_\_\_\_(): Set<T>
6 persistent changes methods.
clear
Returns a new Set containing no values.
clear(): Set<T>
Set
Returns a Set including any value from iterables
that does not already exist in this Set.
\_\_\_\_\_(...iterables: Iterable<any, T>[]): Set<T>\_\_\_\_\_(...iterables: Array<T>[]): Set<T>
6 persistent changes methods.
union
Returns a Set including any value from iterables
that does not already exist in this Set.
union(...iterables: Iterable<any, T>[]): Set<T>union(...iterables: Array<T>[]): Set<T>
Set
Returns a Set which has removed any values not also contained within iterables
.
\_\_\_\_\_(...iterables: Iterable<any, T>[]): Set<T>\_\_\_\_\_(...iterables: Array<T>[]): Set<T>
6 persistent changes methods.
intersect
Returns a Set which has removed any values not also contained within iterables
.
intersect(...iterables: Iterable<any, T>[]): Set<T>intersect(...iterables: Array<T>[]): Set<T>
Set
Returns a Set excluding any values contained within iterables
.
\_\_\_\_\_(...iterables: Iterable<any, T>[]): Set<T>\_\_\_\_\_(...iterables: Array<T>[]): Set<T>
6 persistent changes methods.
subtract
Returns a Set excluding any values contained within iterables
.
subtract(...iterables: Iterable<any, T>[]): Set<T>subtract(...iterables: Array<T>[]): Set<T>
Set
Note: Not all methods can be used on a mutable collection or within \_\_\_\_\_
! Only add
may be used mutatively.
\_\_\_\_\_(mutator: (mutable: Set<T>) => any): Set<T>
3 transient changes methods.
withMutations
Note: Not all methods can be used on a mutable collection or within withMutations
! Only add
may be used mutatively.
withMutations(mutator: (mutable: Set<T>) => any): Set<T>
Set\_\_\_\_\_(): Set<T>
3 transient changes methods.
asMutableasMutable(): Set<T>
Set\_\_\_\_\_(): Set<T>
3 transient changes methods.
asImmutableasImmutable(): Set<T>
OrderedSet
Create a new immutable _____ containing the values of the provided iterable-like.
\_\_\_\_\_<T>():\_\_\_\_\_<T>\_\_\_\_\_<T>(iter: SetIterable<T>):\_\_\_\_\_<T>\_\_\_\_\_<T>(iter: IndexedIterable<T>):\_\_\_\_\_<T>\_\_\_\_\_<K, V>(iter: KeyedIterable<K, V>):\_\_\_\_\_<any>\_\_\_\_\_<T>(array: Array<T>):\_\_\_\_\_<T>\_\_\_\_\_<T>(iterator: Iterator<T>):\_\_\_\_\_<T>\_\_\_\_\_<T>(iterable: Object):\_\_\_\_\_<T>
1 construction methods.
OrderedSet
Create a new immutable OrderedSet containing the values of the provided iterable-like.
OrderedSet<T>(): OrderedSet<T>OrderedSet<T>(iter: SetIterable<T>): OrderedSet<T>OrderedSet<T>(iter: IndexedIterable<T>): OrderedSet<T>OrderedSet<K, V>(iter: KeyedIterable<K, V>): OrderedSet<any>OrderedSet<T>(array: Array<T>): OrderedSet<T>OrderedSet<T>(iterator: Iterator<T>): OrderedSet<T>OrderedSet<T>(iterable: Object): OrderedSet<T>
OrderedSet
True if the provided value is an OrderedSet.
OrderedSet.isOrderedSet(maybeOrderedSet: any): boolean
3 static methods methods.
OrderedSet.isOrderedSet
True if the provided value is an OrderedSet.
OrderedSet.isOrderedSet(maybeOrderedSet: any): boolean
OrderedSet
Creates a new OrderedSet containing values
.
OrderedSet.of<T>(...values: T[]): OrderedSet<T>
3 static methods methods.
OrderedSet.of
Creates a new OrderedSet containing values
.
OrderedSet.of<T>(...values: T[]): OrderedSet<T>
OrderedSet
OrderedSet.fromKeys()
creates a new immutable OrderedSet containing the keys from this Iterable or JavaScript Object.
OrderedSet.fromKeys<T>(iter: Iterable<T, any>): OrderedSet<T>OrderedSet.fromKeys(obj: {[key: string]: any}): OrderedSet<string>
3 static methods methods.
OrderedSet.fromKeys
OrderedSet.fromKeys()
creates a new immutable OrderedSet containing the keys from this Iterable or JavaScript Object.
OrderedSet.fromKeys<T>(iter: Iterable<T, any>): OrderedSet<T>OrderedSet.fromKeys(obj: {[key: string]: any}): OrderedSet<string>
Stack
Create a new immutable _____ containing the values of the provided iterable-like.
\_\_\_\_\_<T>():\_\_\_\_\_<T>\_\_\_\_\_<T>(iter: IndexedIterable<T>):\_\_\_\_\_<T>\_\_\_\_\_<T>(iter: SetIterable<T>):\_\_\_\_\_<T>\_\_\_\_\_<K, V>(iter: KeyedIterable<K, V>):\_\_\_\_\_<any>\_\_\_\_\_<T>(array: Array<T>):\_\_\_\_\_<T>\_\_\_\_\_<T>(iterator: Iterator<T>):\_\_\_\_\_<T>\_\_\_\_\_<T>(iterable: Object):\_\_\_\_\_<T>
1 construction methods.
Stack
Create a new immutable Stack containing the values of the provided iterable-like.
Stack<T>(): Stack<T>Stack<T>(iter: IndexedIterable<T>): Stack<T>Stack<T>(iter: SetIterable<T>): Stack<T>Stack<K, V>(iter: KeyedIterable<K, V>): Stack<any>Stack<T>(array: Array<T>): Stack<T>Stack<T>(iterator: Iterator<T>): Stack<T>Stack<T>(iterable: Object): Stack<T>
Stack
True if the provided value is a Stack
Stack.isStack(maybeStack: any): boolean
2 static methods methods.
Stack.isStack
True if the provided value is a Stack
Stack.isStack(maybeStack: any): boolean
Stack
Creates a new Stack containing values
.
Stack.of<T>(...values: T[]): Stack<T>
2 static methods methods.
Stack.of
Creates a new Stack containing values
.
Stack.of<T>(...values: T[]): Stack<T>
Stack
Alias for Stack.first()
.
\_\_\_\_\_(): T
6 reading values methods.
peek
Alias for Stack.first()
.
peek(): T
Stack
Returns a new Stack with 0 size and no values.
\_\_\_\_\_(): Stack<T>
7 persistent changes methods.
clear
Returns a new Stack with 0 size and no values.
clear(): Stack<T>
Stack
Returns a new Stack with the provided values
prepended, shifting other values ahead to higher indices.
\_\_\_\_\_(...values: T[]): Stack<T>
7 persistent changes methods.
unshift
Returns a new Stack with the provided values
prepended, shifting other values ahead to higher indices.
unshift(...values: T[]): Stack<T>
Stack
Like Stack#unshift
, but accepts a iterable rather than varargs.
\_\_\_\_\_(iter: Iterable<any, T>): Stack<T>\_\_\_\_\_(iter: Array<T>): Stack<T>
7 persistent changes methods.
unshiftAll
Like Stack#unshift
, but accepts a iterable rather than varargs.
unshiftAll(iter: Iterable<any, T>): Stack<T>unshiftAll(iter: Array<T>): Stack<T>
Stack
Returns a new Stack with a size ones less than this Stack, excluding the first item in this Stack, _____ing all other values to a lower index.
\_\_\_\_\_(): Stack<T>
7 persistent changes methods.
shift
Returns a new Stack with a size ones less than this Stack, excluding the first item in this Stack, shifting all other values to a lower index.
shift(): Stack<T>
Stack
Alias for Stack#unshift
and is not equivalent to List#\_\_\_\_\_
.
\_\_\_\_\_(...values: T[]): Stack<T>
7 persistent changes methods.
push
Alias for Stack#unshift
and is not equivalent to List#push
.
push(...values: T[]): Stack<T>
Stack
Alias for Stack#unshiftAll
.
\_\_\_\_\_(iter: Iterable<any, T>): Stack<T>\_\_\_\_\_(iter: Array<T>): Stack<T>
7 persistent changes methods.
pushAll
Alias for Stack#unshiftAll
.
pushAll(iter: Iterable<any, T>): Stack<T>pushAll(iter: Array<T>): Stack<T>
Stack
Alias for Stack#shift
and is not equivalent to List#\_\_\_\_\_
.
\_\_\_\_\_(): Stack<T>
7 persistent changes methods.
pop
Alias for Stack#shift
and is not equivalent to List#pop
.
pop(): Stack<T>
Stack
Note: Not all methods can be used on a mutable collection or within \_\_\_\_\_
! Only set
, push
, and pop
may be used mutatively.
\_\_\_\_\_(mutator: (mutable: Stack<T>) => any): Stack<T>
3 transient changes methods.
withMutations
Note: Not all methods can be used on a mutable collection or within withMutations
! Only set
, push
, and pop
may be used mutatively.
withMutations(mutator: (mutable: Stack<T>) => any): Stack<T>
Stack\_\_\_\_\_(): Stack<T>
3 transient changes methods.
asMutableasMutable(): Stack<T>
Stack\_\_\_\_\_(): Stack<T>
3 transient changes methods.
asImmutableasImmutable(): Stack<T>
Record\_\_\_\_\_(defaultValues: {[key: string]: any}, name?: string):\_\_\_\_\_.Class
1 construction methods.
RecordRecord(defaultValues: {[key: string]: any}, name?: string): Record.Class