From 20ea5287ebd32d6ed163b8d5f95c09a38390201f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loren=20=E2=98=BA=EF=B8=8F?= <251288+lorensr@users.noreply.github.com> Date: Sun, 25 Oct 2020 23:56:03 -0400 Subject: [PATCH] Use "Var" suffix for reactive variable names --- docs/source/local-state/reactive-variables.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/local-state/reactive-variables.mdx b/docs/source/local-state/reactive-variables.mdx index 9dacc6bcde5..8033b1e1be3 100644 --- a/docs/source/local-state/reactive-variables.mdx +++ b/docs/source/local-state/reactive-variables.mdx @@ -14,7 +14,7 @@ Create a reactive variable with the `makeVar` method, like so: ```js import { makeVar } from '@apollo/client'; -const cartItems = makeVar([]); +const cartItemsVar = makeVar([]); ``` This code creates a reactive variable with an empty array as its initial value. @@ -26,10 +26,10 @@ This code creates a reactive variable with an empty array as its initial value. To read the value of your reactive variable, call the function returned by `makeVar` with zero arguments: ```js -const cartItems = makeVar([]); +const cartItemsVar = makeVar([]); // Output: [] -console.log(cartItems()); +console.log(cartItemsVar()); ``` ## Modifying @@ -37,17 +37,17 @@ console.log(cartItems()); To modify the value of your reactive variable, call the function returned by `makeVar` with one argument (the variable's new value): ```js -const cartItems = makeVar([]); +const cartItemsVar = makeVar([]); -cartItems([100, 101, 102]); +cartItemsVar([100, 101, 102]); // Output: [100, 101, 102] -console.log(cartItems()); +console.log(cartItemsVar()); -cartItems([456]); +cartItemsVar([456]); // Output: [456] -console.log(cartItems()); +console.log(cartItemsVar()); ``` ## Reacting