phetsims / phet-core

Core utilities used by all PhET simulations.
MIT License
8 stars 6 forks source link

EnumerationIO type name should have unique identifier #63

Closed samreid closed 5 years ago

samreid commented 5 years ago

Similar to https://github.com/phetsims/axon/issues/257

samreid commented 5 years ago

Some raw notes from discussion:

goal: type name should be unique

  1. name with values. "EnumerationIO(ZEBRA,BABOON,LUMPSUCKER)"
  2. name the type. "AnimalTypeIO"

const myEnum1 = new Enumeration('A','B') const myEnum2 = new Enumeration('A','B') // gets assigned _2

We are leaning toward (1) with assertions to guard.

zepumph commented 5 years ago

Currently, especially from work in phetsims/tandem#100, EnumerationIO type names have unique identifiers (their values). Further cleanup will be done in https://github.com/phetsims/phet-io/issues/1545. @samreid can this issue be closed?

samreid commented 5 years ago

Thanks, it seems this issue is ready to close.