phetsims / utterance-queue

Alerting library powered by aria-live
http://scenerystack.org/
MIT License
1 stars 2 forks source link

speechAllowedAndFullyEnabledProperty should be a DerivedProperty #72

Closed zepumph closed 2 years ago

zepumph commented 2 years ago

Instead of a multilink, let's make this a DerivedProperty|null, and set in initialize. I'll report back

zepumph commented 2 years ago

I immediately hit an issue where the Property was null when we needed to wire into it:

https://github.com/phetsims/scenery/blob/1445110b031dd9ad0c5f2397b9ecf27f05e865e6/js/accessibility/voicing/ReadingBlock.ts#L157-L156

This line is called before the initialize is called.

So instead I used a new pattern I have been happy about where we hide the settable API so that it still is read-only as it pertains to the public API of the Announcer. I think this is an improvement. Anything else here?

jessegreenberg commented 2 years ago

I see, this pattern makes sense to me. Thanks!