emplace | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Function emplace

    • Place a value into a Map

      Type Parameters

      • T extends Map<any, any> | WeakMap<any, any>

      Parameters

      • map: T

        The map to place the value into

      • key: T extends Map<K, any> ? K : T extends WeakMap<K, any> ? K : never

        The key to add/replace

      • Optionalhandler: T extends Map<any, V>
            ? EmplaceHandler<V>
            : T extends WeakMap<any, V> ? EmplaceHandler<V> : never

        Callbacks for inserting or updating the value

      Returns T extends Map<any, V> ? V : T extends WeakMap<any, V> ? V : never

      The value that was placed into the map.

      If the key is not found and no insert handler is provided