From b828444ea8780ceff2bfcff763a374155262f002 Mon Sep 17 00:00:00 2001 From: Karishma Chadha Date: Mon, 26 Nov 2018 12:26:54 -0500 Subject: [PATCH] Update comments for addCloudVariable and removeCloudVariable. --- src/engine/runtime.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index d05c14007..690ef4a1c 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -364,13 +364,17 @@ class Runtime extends EventEmitter { /** * A function that tracks a new cloud variable in the runtime, - * updating the cloud variable limit. + * updating the cloud variable limit. Calling this function will + * emit a cloud data update event if this is the first cloud variable + * being added. + * @type {function} */ this.addCloudVariable = this._initializeAddCloudVariable(newCloudDataManager); /** * A function which updates the runtime's cloud variable limit - * when removing a cloud variable. + * when removing a cloud variable and emits a cloud update event + * if the last of the cloud variables is being removed. * @type {function} */ this.removeCloudVariable = this._initializeRemoveCloudVariable(newCloudDataManager); @@ -647,6 +651,7 @@ class Runtime extends EventEmitter { // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- + // Helper function for initializing the addCloudVariable function _initializeAddCloudVariable (newCloudDataManager) { // The addCloudVariable function return (() => { @@ -658,6 +663,7 @@ class Runtime extends EventEmitter { }); } + // Helper function for initializing the removeCloudVariable function _initializeRemoveCloudVariable (newCloudDataManager) { return (() => { const hadCloudVarsBefore = this.hasCloudData();