types.YMap()

A shared Map implementation.

new YMap()

Methods

delete(key)

Remove a specified element from this YMap.

Parameters:
Name Type Description
key string

The key of the element to remove.

get(key)

Returns a specified element from this YMap.

Parameters:
Name Type Description
key string

The key of the element to return.

has(key)

Returns a boolean indicating whether the specified key exists or not.

Parameters:
Name Type Description
key string

The key to test.

keys() → {Array}

Returns the keys for each element in the YMap Type.

Returns:
Array

set(key, value)

Adds or updates an element with a specified key and value.

Parameters:
Name Type Description
key string

The key of the element to add to this YMap

value Object | string | number | Type

The value of the element to add

toJSON() → {Object}

Transforms this Shared Type to a JSON object.

Returns:
Object