mobx-keystone
    Preparing search index...

    Class ArraySet<V>

    A set that is backed by an array. Use arraySet to create it.

    Type Parameters

    • V

    Hierarchy

    • arraySetBase
      • ArraySet

    Implements

    • Set<V>
    Index

    Constructors

    • Type Parameters

      • V

      Parameters

      • data: any

      Returns ArraySet<V>

    Properties

    "[fromSnapshotOverrideTypeSymbol]": any
    "[modelIdPropertyNameSymbol]": any
    "[propsTypeSymbol]": any
    "[toSnapshotOverrideTypeSymbol]": any
    "[toStringTag]": "ArraySet"
    $: { items: V[] }
    $modelType: string

    Model type name.

    items: V[]

    Accessors

    • get size(): number

      Returns number

      the number of (unique) elements in Set.

    Methods

    • Returns SetIterator<V>

    • Appends a new element with a specified value to the end of the Set.

      Parameters

      • value: V

      Returns this

    • Returns void

    • Removes a specified value from the Set.

      Parameters

      • value: V

      Returns boolean

      Returns true if an element in the Set existed and has been removed, or false if the element does not exist.

    • Type Parameters

      • U

      Parameters

      • other: ReadonlySetLike<U>

      Returns Set<V>

      a new Set containing all the elements in this Set which are not also in the argument.

    • Returns an iterable of [v,v] pairs for every value v in the set.

      Returns SetIterator<[V, V]>

    • Executes a provided function once per each value in the Set object, in insertion order.

      Parameters

      • callbackfn: (value: V, value2: V, set: Set<V>) => void
      • OptionalthisArg: any

      Returns void

    • Can be overridden to offer a reference id to be used in reference resolution. By default it will use the idProp if available or return undefined otherwise.

      Returns string | undefined

    • Parameters

      • value: V

      Returns boolean

      a boolean indicating whether an element with the specified value exists in the Set or not.

    • Type Parameters

      • U

      Parameters

      • other: ReadonlySetLike<U>

      Returns Set<V & U>

      a new Set containing all the elements which are both in this Set and in the argument.

    • Parameters

      • other: ReadonlySetLike<unknown>

      Returns boolean

      a boolean indicating whether this Set has no elements in common with the argument.

    • Parameters

      • other: ReadonlySetLike<unknown>

      Returns boolean

      a boolean indicating whether all the elements in this Set are also in the argument.

    • Parameters

      • other: ReadonlySetLike<unknown>

      Returns boolean

      a boolean indicating whether all the elements in the argument are also in this Set.

    • Despite its name, returns an iterable of the values in the set.

      Returns SetIterator<V>

    • Type Parameters

      • U

      Parameters

      • other: ReadonlySetLike<U>

      Returns Set<V | U>

      a new Set containing all the elements which are in either this Set or in the argument, but not in both.

    • Parameters

      • Optionaloptions: { withData?: boolean }

      Returns string

    • Performs a type check over the model instance. For this to work a data type has to be declared as part of the model properties.

      Returns TypeCheckError | null

      A TypeCheckError or null if there is no error.

    • Type Parameters

      • U

      Parameters

      • other: ReadonlySetLike<U>

      Returns Set<V | U>

      a new Set containing all the elements in this Set and also all the elements in the argument.

    • Returns an iterable of values in the set.

      Returns SetIterator<V>