downloads
Across all versions.
Download trend unavailable.
compatibility
Runtime metadata.
keywords
Tagged topics.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Manage map-like data with this shareable map type. You can insert and delete objects in y-map. The objects must either be a custom types, or fulfill the following property: v equals JSON.parse(JSON.stringify(v)) (according to your definition of equality)
Retrieve this with bower or npm.
bower install y-map --savenpm install y-map --saveY.Map mimics the behaviour of a javascript Object. You can create, update, and remove properies on this type. Furthermore, you can observe changes on this type as you can observe changes on Javascript Objects with Object.observe - an ECMAScript 7 proposal which is likely to become accepted by the committee. Until then, we have our own implementation.
map.set(key, Y.Map)value equals JSON.parse(JSON.stringify(value)) (according to your notion of equality)observer is called whenever something on this object changes. Throws add, update, and delete eventsevent object has the following properties:
event.type The type of the event. "add" - a new key-value pair was added, "update" - an existing key-value pair was changed, or "delete" - a key-value pair was deleted)event.name The key of the changed propertyevent.value If event type is either "update" or "add", this property defines the new value of the key-value pairevent.object The object on which the event occurred (The object on which .observe(..) was called)event.path specifies the path of the change eventpath is an array of property keysWhen users create/update/delete the same property concurrently, only one change will prevail. Changes on different properties do not conflict with each other.
Yjs is licensed under the MIT License.
observer is when the value under the path is foundobserver is called when the property under path is set, deleted, or updated