You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of our migration to TypeScript #1046 will involve discovery and identification of patterns & conventions for how we wish to use TypeScript. Here is an initial list, which is expected to grow as we learn more:
How should we implement Enumerations? Should we use string literals or enum? See https://thisthat.dev/literal-union-type-vs-string-enums/. enum would be fine if we have a lint rule for matching key names to values. Otherwise, string literal unions seems good? May still need EnumerationIO for phet-io ones? Or will we want a lightweight EnumerationIO that complements string union? Vanderkam book recommends string literal union since it works via structural typing like the rest of typescript rather than named typing. Typescript Convention: How should we implement enumerations with TypeScript? #1106
Part of our migration to TypeScript #1046 will involve discovery and identification of patterns & conventions for how we wish to use TypeScript. Here is an initial list, which is expected to grow as we learn more:
https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#differences-between-type-aliases-and-interfaces says
The text was updated successfully, but these errors were encountered: