From 25106dd54c6f0d42dde889e3b4e118a25c7e4a52 Mon Sep 17 00:00:00 2001 From: emmawillis Date: Wed, 15 Mar 2023 15:21:42 -0400 Subject: [PATCH] Update javascript.md --- docs/sdk/client-side-sdks/javascript.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/sdk/client-side-sdks/javascript.md b/docs/sdk/client-side-sdks/javascript.md index c9f5ee0e..0f8ca718 100644 --- a/docs/sdk/client-side-sdks/javascript.md +++ b/docs/sdk/client-side-sdks/javascript.md @@ -264,8 +264,9 @@ dvcClient.subscribe( "variableUpdated:*", (key: string, variable: DVCVariable) => { // key is the variable that has been updated - // The new value can be accessed from the variable object passed in: variable.value - console.log(`New variable value for variable ${key}: ${variable.value}`); + // The new value can be accessed from the variable object passed in: variable?.value + // The variable argument will be undefined if the variable is no longer being served a value + console.log(`New variable value for variable ${key}: ${variable?.value}`); } ); ```