Skip to content

Commit

Permalink
support options passed to Disposable, phetsims/axon#436
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jun 22, 2023
1 parent 27e4a55 commit c9d7b4d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/Utterance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import NumberIO from '../../tandem/js/types/NumberIO.js';
import OrIO from '../../tandem/js/types/OrIO.js';
import Property from '../../axon/js/Property.js';
import TReadOnlyProperty from '../../axon/js/TReadOnlyProperty.js';
import Disposable from '../../axon/js/Disposable.js';
import Disposable, { DisposableOptions } from '../../axon/js/Disposable.js';

// constants
const DEFAULT_PRIORITY = 1;
Expand Down Expand Up @@ -109,7 +109,7 @@ type SelfOptions = {
priority?: number;
};

export type UtteranceOptions = SelfOptions;
export type UtteranceOptions = SelfOptions & DisposableOptions;

class Utterance extends Disposable implements FeatureSpecificAnnouncingControlPropertySupported {
private readonly id: number;
Expand Down Expand Up @@ -146,7 +146,7 @@ class Utterance extends Disposable implements FeatureSpecificAnnouncingControlPr

public constructor( providedOptions?: UtteranceOptions ) {

const options = optionize<UtteranceOptions, SelfOptions>()( {
const options = optionize<UtteranceOptions, SelfOptions, DisposableOptions>()( {
alert: null,
predicate: function() { return true; },
canAnnounceProperties: [],
Expand All @@ -158,7 +158,7 @@ class Utterance extends Disposable implements FeatureSpecificAnnouncingControlPr
priority: DEFAULT_PRIORITY
}, providedOptions );

super();
super( options );

this.id = globalIdCounter++;

Expand Down

0 comments on commit c9d7b4d

Please sign in to comment.