Properties:
| Name | Type | Description |
|---|---|---|
sid |
String | Map unique id |
Fires:
Methods
-
get(key)
-
Parameters:
Name Type Description keyString String identifier of entity in a map Returns:
- Type
- Promise.<Item>
-
getItems(args)
-
Get a list of items from the Map
Parameters:
Name Type Description argsObject Arguments for query Properties
Name Type Description fromString Item, which should be used as an anchor. If undefined, starts from the beginning or end depending on args.order pageSizeNumber Result page size orderString Order of results, should be 'asc' or 'desc' Returns:
- Type
- Promise.<Paginator>
-
mutate(Key, Mutator)
-
Parameters:
Name Type Description KeyString Item key MutatorMap~Mutator Function performing value mutation -
remove()
-
Delete an entity by given key
Returns:
- Type
- Promise
-
removeMap()
-
Delete map from server. It will be impossible to restore it.
Returns:
Promise to delete the collection- Type
- Promise
-
set(key, value [, conditional])
-
Set key and value pair in map
Parameters:
Name Type Argument Default Description keyString Key identifier valueObject Value to set conditionalBoolean <optional>
false Check for remote modification when updating. If true, promise will be rejected if value was remotely modified Returns:
- Type
- Promise.<Item>
-
update(key, update)
-
Parameters:
Name Type Description keyString Item key updateObject Set of fields to update Returns:
Result data- Type
- Promise.<Item>
Type Definitions
-
Mutator(data)
-
Applies a transformation to the item value
Parameters:
Name Type Description dataObject current value of an item Returns:
Modified data for an item- Type
- Object
Events
-
collectionRemoved
-
Fired when Map is removed from server
-
itemAdded
-
Fired when item is added to Map
Type: Item
-
itemRemoved
-
Fired when item is added to Map
Type: String
-
itemUpdated
-
Fired when item is added to Map
Type: Item