From 48926a33e02da94c9f490a473c627388b42ee134 Mon Sep 17 00:00:00 2001 From: samreid Date: Fri, 2 Oct 2020 14:06:10 -0600 Subject: [PATCH] Migrate from ObservableArray => createObservableArray (Proxy), see https://github.com/phetsims/axon/issues/336 --- js/common/model/Graph.js | 4 ++-- js/common/model/LineFormsModel.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/common/model/Graph.js b/js/common/model/Graph.js index 2f5ebb99..f0d88afd 100644 --- a/js/common/model/Graph.js +++ b/js/common/model/Graph.js @@ -6,7 +6,7 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import ObservableArray from '../../../../axon/js/ObservableArray.js'; +import createObservableArray from '../../../../axon/js/createObservableArray.js'; import Vector2 from '../../../../dot/js/Vector2.js'; import graphingLines from '../../graphingLines.js'; @@ -21,7 +21,7 @@ class Graph { // @public this.xRange = xRange; this.yRange = yRange; - this.lines = new ObservableArray(); // {Line} lines that the graph is currently displaying + this.lines = createObservableArray(); // {Line} lines that the graph is currently displaying } // @public diff --git a/js/common/model/LineFormsModel.js b/js/common/model/LineFormsModel.js index c251972c..76cb60b0 100644 --- a/js/common/model/LineFormsModel.js +++ b/js/common/model/LineFormsModel.js @@ -6,7 +6,7 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import ObservableArray from '../../../../axon/js/ObservableArray.js'; +import createObservableArray from '../../../../axon/js/createObservableArray.js'; import Property from '../../../../axon/js/Property.js'; import Bounds2 from '../../../../dot/js/Bounds2.js'; import Vector2 from '../../../../dot/js/Vector2.js'; @@ -41,8 +41,8 @@ class LineFormsModel { this.modelViewTransform = ModelViewTransform2.createOffsetXYScaleMapping( ORIGIN_OFFSET, modelViewTransformScale, -modelViewTransformScale ); // y is inverted // @public static lines - this.savedLines = new ObservableArray(); - this.standardLines = new ObservableArray(); + this.savedLines = createObservableArray(); + this.standardLines = createObservableArray(); // Update the lines seen by the graph. // unmultilink is unnecessary because we own these Properties, and the model exists for the lifetime of the sim.