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
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
Returns the number of items after applying any deferred merges.
< <T> >

Returns the default iterator over values after forcing pending merges.


add(item): void
  • item {T} an item
  • Returns: <LazySet><<T>> itself

Adds a single item immediately to the concrete backing set.


addAll(iterable): LazySet
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): void
  • 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
< <Tuple> < <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:<Function>
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): void
  • 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> > 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> > 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>
< <T> , <TReturn> , <TNext> >

< <T> , <undefined> >
Returns:<void>
< <T> >