RSX Code Reference
    Preparing search index...
    • rsx
    • DynamicMap

    Class DynamicMap<K, V>

    The DynamicMap implements a Map that dynamically creates values for requested keys. If a call to get is made for a key that does not exist yet, the fnCreateValue callback will be invoked to create the value dynamically.

    This map is most useful to create systems that dynamically cache objects that are lazily created.

    Type Parameters

    • K
    • V
    Index
    • Type Parameters

      • K
      • V

      Parameters

      • fnCreateValue: (key: K) => V

      Returns DynamicMap<K, V>

    _internal: Map<K, V>
    "[toStringTag]": string
    fnCreateValue: (key: K) => V
    • get length(): number

      Returns number

    • get size(): number

      Returns number

    • Returns MapIterator<[K, V]>

    • Returns void

    • Parameters

      • key: K

      Returns boolean

    • Returns MapIterator<[K, V]>

    • Parameters

      • callbackfn: (value: V, key: K, map: Map<K, V>) => void
      • OptionalthisArg: any

      Returns void

    • Returns a specified element from the Map object.

      Parameters

      • key: K

      Returns V

      Returns the element associated with the specified key. If no element is associated with the specified key, the value is created.

      If the key does not exist in the dynamic map, the fnCreateValue callback will be invoked to create the key. The resulting value is then internally retained by the dynamic map.

      If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.

    • Parameters

      • key: K

      Returns boolean

    • Returns MapIterator<K>

    • Parameters

      • key: K
      • value: V

      Returns this

    • Returns MapIterator<V>