From 15c7181b222ae6c85b13abfde7775364c010e1e4 Mon Sep 17 00:00:00 2001 From: Sam Reid Date: Mon, 11 Dec 2023 10:44:32 -0700 Subject: [PATCH] Add documentation, see https://github.com/phetsims/projectile-data-lab/issues/10 --- js/DynamicProperty.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/DynamicProperty.ts b/js/DynamicProperty.ts index c8a0028..45e1d5e 100644 --- a/js/DynamicProperty.ts +++ b/js/DynamicProperty.ts @@ -59,6 +59,7 @@ * defaultValue: Color.BLACK * } ); * So that if the currentSceneProperty's value is null, the value of our DynamicProperty will be Color.BLACK. + * NOTE there are constraints using derive: 'string' when using parametric type parameters. See https://github.com/phetsims/projectile-data-lab/issues/10 * ******************************* * 'bidirectional' option @@ -120,6 +121,7 @@ type SelfOptions = { // If it's a string, it will grab that named property out (e.g. it's like passing u => u[ derive ]) // NOTE: This accepts TReadOnlyProperty, but if you have bidirectional:true it must be a full TProperty. // This is not currently type checked. + // NOTE there are constraints using derive: 'string' when using parametric type parameters. See https://github.com/phetsims/projectile-data-lab/issues/10 derive?: ( ( outerValue: OuterValueType ) => TReadOnlyProperty ) | KeysMatching>; // Maps our input Property value to/from this Property's value. See top-level documentation for usage.