Skip to content

Commit

Permalink
Remove unnecessary optionize calls, see: #43
Browse files Browse the repository at this point in the history
marlitas committed Aug 22, 2022
1 parent d2fe261 commit c402c5a
Showing 4 changed files with 9 additions and 17 deletions.
8 changes: 3 additions & 5 deletions js/common/view/MeanShareAndBalanceScreenView.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,6 @@ import ResetAllButton from '../../../../scenery-phet/js/buttons/ResetAllButton.j
import MeanShareAndBalanceConstants from '../MeanShareAndBalanceConstants.js';
import meanShareAndBalance from '../../meanShareAndBalance.js';
import MeanShareAndBalanceModel from '../model/MeanShareAndBalanceModel.js';
import optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js';
import PickRequired from '../../../../phet-core/js/types/PickRequired.js';
import { AlignBox, GridBox, TColor, Text, VBox } from '../../../../scenery/js/imports.js';
import QuestionBar from '../../../../scenery-phet/js/QuestionBar.js';
@@ -23,9 +22,7 @@ import NumberSpinner from '../../../../sun/js/NumberSpinner.js';
import Property from '../../../../axon/js/Property.js';
// import SyncButton from './SyncButton.js';

type SelfOptions = EmptySelfOptions;

export type MeanShareAndBalanceScreenViewOptions = SelfOptions & PickRequired<ScreenViewOptions, 'tandem'>;
export type MeanShareAndBalanceScreenViewOptions = PickRequired<ScreenViewOptions, 'tandem'>;

export default class MeanShareAndBalanceScreenView extends ScreenView {
public readonly resetAllButton: ResetAllButton;
@@ -35,10 +32,11 @@ export default class MeanShareAndBalanceScreenView extends ScreenView {
public readonly questionBar: QuestionBar;
private readonly controlsAlignBox: AlignBox;
public readonly dataStateVBox: VBox;

// public readonly syncButton: SyncButton;

protected constructor( model: MeanShareAndBalanceModel, questionBarText: string, questionBarColor: TColor, numberSpinnerProperty: Property<number>, providedOptions: MeanShareAndBalanceScreenViewOptions ) {
const options = optionize<MeanShareAndBalanceScreenViewOptions, SelfOptions, ScreenViewOptions>()( {}, providedOptions );
const options = providedOptions;

super( options );

8 changes: 3 additions & 5 deletions js/intro/model/IntroModel.ts
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ import Range from '../../../../dot/js/Range.js';
import meanShareAndBalance from '../../meanShareAndBalance.js';
import Pipe from './Pipe.js';
import MeanShareAndBalanceConstants from '../../common/MeanShareAndBalanceConstants.js';
import optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js';
import WaterCup from './WaterCup.js';
import Utils from '../../../../dot/js/Utils.js';
import Vector2 from '../../../../dot/js/Vector2.js';
@@ -25,9 +24,8 @@ import Property from '../../../../axon/js/Property.js';
import NumberIO from '../../../../tandem/js/types/NumberIO.js';
import MeanShareAndBalanceQueryParameters from '../../common/MeanShareAndBalanceQueryParameters.js';

type SelfOptions = EmptySelfOptions;

type IntroModelOptions = SelfOptions & PickRequired<MeanShareAndBalanceModelOptions, 'tandem'>;
type IntroModelOptions = PickRequired<MeanShareAndBalanceModelOptions, 'tandem'>;

export default class IntroModel extends MeanShareAndBalanceModel {

@@ -45,9 +43,9 @@ export default class IntroModel extends MeanShareAndBalanceModel {
public readonly pipeArray: Pipe[];
public readonly arePipesOpenProperty: Property<boolean>;

public constructor( providedOptions?: IntroModelOptions ) {
public constructor( providedOptions: IntroModelOptions ) {

const options = optionize<IntroModelOptions, SelfOptions, MeanShareAndBalanceModelOptions>()( {}, providedOptions );
const options = providedOptions;
super( options );

this.meanPredictionProperty = new NumberProperty( 0, {
6 changes: 2 additions & 4 deletions js/intro/view/IntroScreenView.ts
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@
*/

import MeanShareAndBalanceScreenView, { MeanShareAndBalanceScreenViewOptions } from '../../common/view/MeanShareAndBalanceScreenView.js';
import optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js';
import { Node } from '../../../../scenery/js/imports.js';
import IntroModel from '../model/IntroModel.js';
import Property from '../../../../axon/js/Property.js';
@@ -28,9 +27,8 @@ import Dimension2 from '../../../../dot/js/Dimension2.js';
import ValveNode from './ValveNode.js';
import TableNode from './TableNode.js';

type SelfOptions = EmptySelfOptions;

type LevelingOutScreenViewOptions = SelfOptions & MeanShareAndBalanceScreenViewOptions;
type LevelingOutScreenViewOptions = MeanShareAndBalanceScreenViewOptions;

export default class IntroScreenView extends MeanShareAndBalanceScreenView {
private readonly pipeNodes: PipeNode[];
@@ -40,7 +38,7 @@ export default class IntroScreenView extends MeanShareAndBalanceScreenView {

public constructor( model: IntroModel, providedOptions: LevelingOutScreenViewOptions ) {

const options = optionize<LevelingOutScreenViewOptions, SelfOptions, MeanShareAndBalanceScreenViewOptions>()( {}, providedOptions );
const options = providedOptions;
super( model, meanShareAndBalanceStrings.introQuestion, MeanShareAndBalanceColors.introQuestionBarColorProperty, model.numberOfCupsProperty, options );

this.predictMeanVisibleProperty = new BooleanProperty( false, {
4 changes: 1 addition & 3 deletions js/intro/view/WaterCup2DTickMarksNode.ts
Original file line number Diff line number Diff line change
@@ -7,13 +7,11 @@
* @author Sam Reid (PhET Interactive Simulations)
*/

import { EmptySelfOptions } from '../../../../phet-core/js/optionize.js';
import PickRequired from '../../../../phet-core/js/types/PickRequired.js';
import { Line, Node, NodeOptions } from '../../../../scenery/js/imports.js';
import meanShareAndBalance from '../../meanShareAndBalance.js';

type SelfOptions = EmptySelfOptions;
type TickMarksNodeOptions = SelfOptions & PickRequired<NodeOptions, 'visibleProperty' | 'tandem'>;
type TickMarksNodeOptions = PickRequired<NodeOptions, 'visibleProperty' | 'tandem'>;

export default class WaterCup2DTickMarksNode extends Node {

0 comments on commit c402c5a

Please sign in to comment.