On this page

Like Set but with an addAll method to eventually add items from another iterable. Access methods make sure that all delayed operations are executed. Iteration methods deopts to normal Set performance until clear is called again (because of the chance of modifications during iteration).

new LazySet(iterable?): LazySet<T>
Attributes
iterable:Iterable<T, any, any>
init iterable
Returns:LazySet<T>

Seeds the set with an optional iterable while preparing internal queues for deferred merges.

Attributes
size:number
Returns the number of items after applying any deferred merges.
Returns:SetIterator<T>

Returns the default iterator over values after forcing pending merges.


add(item): LazySet<T>
Attributes
item:T
an item
Returns:LazySet<T>
itself

Adds a single item immediately to the concrete backing set.


addAll(iterable): LazySet<T>
Attributes
iterable:LazySet<T> | Iterable<T, any, any>
a immutable iterable or another immutable LazySet which will eventually be merged into the Set
Returns:LazySet<T>
itself

Queues another iterable or lazy set for later merging so large bulk adds can stay cheap until the set is read.


clear(): void
Returns:void

Removes all items and clears every deferred merge queue.


delete(value): boolean
Attributes
value:T
an item
Returns:boolean
true, if the value was in the Set before

Deletes an item after first materializing any deferred additions that may contain it.


entries(): SetIterator<[T, T]>
Returns:SetIterator<[T, T]>
entries

Returns the set's entry iterator and permanently switches future operations to eager merge mode to preserve iterator correctness.


forEach(callbackFn, thisArg): void
Attributes
callbackFn:(value: T, value2: T, set: Set<T>) => void
function called for each entry
thisArg:K
this argument for the callbackFn
Returns:void

Iterates over every item after forcing pending merges and switching to eager mode for correctness during iteration.


has(item): boolean
Attributes
item:T
an item
Returns:boolean
true, when the item is in the Set

Checks whether an item is present after applying any deferred merges.


keys(): SetIterator<T>
Returns:SetIterator<T>
keys

Returns the key iterator, eagerly materializing pending merges first.


serialize(objectSerializerContext): void
Attributes
objectSerializerContext:ObjectSerializerContext
Returns:void

Serializes the fully materialized set contents into webpack's object serialization stream.


values(): SetIterator<T>
Returns:SetIterator<T>
values

Returns the value iterator, eagerly materializing pending merges first.


Attributes
objectDeserializerContext:ObjectDeserializerContext
Returns:LazySet<T>
lazy set

Restores a LazySet from serialized item data.

Returns:void

Extends:Iterator<T, TReturn, TNext>
Returns:void
Returns:IteratorObject<T, TReturn, TNext>

Returns:void
Returns:SetIterator<T>