From 77c7fc969f1a3355168ff93bb2a31ef29840cce3 Mon Sep 17 00:00:00 2001 From: Cole Lawrence Date: Wed, 6 Apr 2022 13:45:49 -0400 Subject: [PATCH] Update GET_STARTED.md (#119) --- packages/dataverse/docs/GET_STARTED.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/dataverse/docs/GET_STARTED.md b/packages/dataverse/docs/GET_STARTED.md index 443f777..8964471 100644 --- a/packages/dataverse/docs/GET_STARTED.md +++ b/packages/dataverse/docs/GET_STARTED.md @@ -112,7 +112,7 @@ A few notes about the example above: - `variableB.derivation.changesWithoutValues()` returns a tappable that we can tap into (observe). -- The `tap()` method returns the `untap()` function which aborts th +- The `tap()` method returns the `untap()` function which unsubscribes the observer function - As long as `variableB` is tapped (observed) `variableB.derivation.isHot` will bet set to `true` automatically @@ -267,7 +267,7 @@ import {prism} from '@theatre/dataverse' const mousePositionD = prism(() => { // Create an internal state (`pos`) where the position of the mouse // will be stored, and a function that updates it (`setPos`) - const [pos, setPos] = prism.state<[x: number, y: number]>('pos', [0, 0]) + const [pos, setPos] = prism.state('pos', {x: 0, y: 0}) // Create a side effect that attaches the `mousemove` event listeners // to the `document` @@ -293,14 +293,14 @@ const mousePositionD = prism(() => { // Display the current position of the mouse using a `h2` element const p = document.createElement('h2') -const [x, y] = mousePositionD.getValue() +const {x, y} = mousePositionD.getValue() p.textContent = `Position of the cursor: [${x}, ${y}]` document.querySelector('body')?.append(p) // Update the element's content when the position of the mouse // changes mousePositionD.changesWithoutValues().tap(() => { - const [x, y] = mousePositionD.getValue() + const {x, y} = mousePositionD.getValue() p.textContent = `Position of the cursor: [${x}, ${y}]` }) ```