From ca15f878939a3717e430ec46fadb168609cf5b9e Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Mon, 8 Jun 2020 10:14:18 -0600 Subject: [PATCH 1/4] fixes https://github.com/phetsims/axon/issues/302 --- js/Multilink.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/js/Multilink.js b/js/Multilink.js index 5ecf0dfd..b450f1ad 100644 --- a/js/Multilink.js +++ b/js/Multilink.js @@ -1,10 +1,17 @@ // Copyright 2014-2020, University of Colorado Boulder /** - * A Multilink is an instance that can be used to link to multiple properties. It is very similar to a DerivedProperty, - * but has no value and does not conform to the Property API because it is intended for use with callbacks that do not - * compute a value. Multilink should not be created through calling its constructor directly, but through the - * Property.multilink and Property.lazyMultilink functions. + * Multilink is used to link to multiple properties. It is very similar to a DerivedProperty, but has no value and + * does not conform to the Property API because it is intended for use with callbacks that do not compute a value. + * + * For situations where a reference to the Multilink is not needed (for calling dispose), use convenience method + * Property.multilink or Property.lazyLink to avoid these types of lint errors: + * + * // lint error: Do not use 'new' for side effects (no-new) + * new Multilink( ... ); + * + * // lint error: 'multilink' is assigned a value but never used (no-unused-vars) + * const multilink = new Multilink( ... ); * * @author Sam Reid (PhET Interactive Simulations) */ From 2ef6eedaf0e4d8bfcf81cabb7f7ef4cdb9082c2c Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Mon, 8 Jun 2020 10:14:54 -0600 Subject: [PATCH 2/4] typos https://github.com/phetsims/axon/issues/302 --- js/Multilink.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/Multilink.js b/js/Multilink.js index b450f1ad..8b89fcef 100644 --- a/js/Multilink.js +++ b/js/Multilink.js @@ -4,8 +4,8 @@ * Multilink is used to link to multiple properties. It is very similar to a DerivedProperty, but has no value and * does not conform to the Property API because it is intended for use with callbacks that do not compute a value. * - * For situations where a reference to the Multilink is not needed (for calling dispose), use convenience method - * Property.multilink or Property.lazyLink to avoid these types of lint errors: + * For situations where a reference to the Multilink instance is not needed (for calling dispose), use convenience + * methods Property.multilink or Property.lazyLink to avoid these types of lint errors: * * // lint error: Do not use 'new' for side effects (no-new) * new Multilink( ... ); From ddf909903296d1c0fc09bd7fce27d68fc13ee2d1 Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Mon, 8 Jun 2020 15:05:17 -0600 Subject: [PATCH 3/4] https://github.com/phetsims/chipper/issues/932 --- js/ObservableArray.js | 2 ++ js/PropertyStateHandler.js | 1 + 2 files changed, 3 insertions(+) diff --git a/js/ObservableArray.js b/js/ObservableArray.js index ba3a7d51..0dc2f8d4 100644 --- a/js/ObservableArray.js +++ b/js/ObservableArray.js @@ -361,6 +361,7 @@ class ObservableArray extends PhetioObject { * Returns true if some element in this ObservableArray matches the predicate. * @param {function(item:*):boolean} predicate * @returns {boolean} + * @public */ some( predicate ) { return _.some( this._array, predicate ); @@ -430,6 +431,7 @@ class ObservableArray extends PhetioObject { * Changes the ordering of elements in the array. Requires a Random source so that shuffles can be reproducible. * No items are added or removed, and this method does not send out any notifications. * @param {Random} random - from dot + * @public */ shuffle( random ) { assert && assert( random, 'random must be supplied' ); diff --git a/js/PropertyStateHandler.js b/js/PropertyStateHandler.js index 27dbfd4d..db4880ca 100644 --- a/js/PropertyStateHandler.js +++ b/js/PropertyStateHandler.js @@ -41,6 +41,7 @@ class PropertyStateHandler { /** * @param {PhetioStateEngine} phetioStateEngine + * @publicF */ initialize( phetioStateEngine ) { assert && assert( !this.initialized, 'cannot initialize twice' ); From f9afc505f8f008e07a32080076aa75e6c2f8b44a Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Mon, 8 Jun 2020 15:09:37 -0600 Subject: [PATCH 4/4] https://github.com/phetsims/chipper/issues/932 --- js/PropertyStateHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/PropertyStateHandler.js b/js/PropertyStateHandler.js index db4880ca..9fcb7a8a 100644 --- a/js/PropertyStateHandler.js +++ b/js/PropertyStateHandler.js @@ -41,7 +41,7 @@ class PropertyStateHandler { /** * @param {PhetioStateEngine} phetioStateEngine - * @publicF + * @public */ initialize( phetioStateEngine ) { assert && assert( !this.initialized, 'cannot initialize twice' );