From 9f9309e58dae34e2be14da2ab28b9206e591db3b Mon Sep 17 00:00:00 2001 From: Mansehej Date: Tue, 19 May 2020 02:51:43 +0530 Subject: [PATCH] Implement chaining for YMap functions --- src/types/YMap.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/types/YMap.js b/src/types/YMap.js index f0f06630..8f35168b 100644 --- a/src/types/YMap.js +++ b/src/types/YMap.js @@ -161,6 +161,7 @@ export class YMap extends AbstractType { * Remove a specified element from this YMap. * * @param {string} key The key of the element to remove. + * @return {YMap} Instance of the YMap. */ delete (key) { if (this.doc !== null) { @@ -170,6 +171,7 @@ export class YMap extends AbstractType { } else { /** @type {Map} */ (this._prelimContent).delete(key) } + return this } /** @@ -177,6 +179,7 @@ export class YMap extends AbstractType { * * @param {string} key The key of the element to add to this YMap * @param {T} value The value of the element to add + * @return {YMap} Instance of the YMap */ set (key, value) { if (this.doc !== null) { @@ -186,7 +189,7 @@ export class YMap extends AbstractType { } else { /** @type {Map} */ (this._prelimContent).set(key, value) } - return value + return this } /**