We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The latest flow release shows the following example:
const Enum = Object.freeze({ X: 'x', Y: 'y', }); type EnumT = $Values<typeof Enum> ('a': EnumT); // Fails
Is it possible to do this without the run-time Object.freeze()? This raises browser-support and performance concerns.
Object.freeze()
I tried this but it didn't work:
type FrozenEnum = { +[string]: string } const Enum : FrozenEnum = { X: 'x', Y: 'y', }; type EnumT = $Values<typeof Enum> ('a': EnumT); // Doesn't fail but should
How can I mark the Enum as being frozen, without using Object.freeze?
Enum
Object.freeze
The text was updated successfully, but these errors were encountered:
@bluepnume Not exactly what you want to see, but you might not need the runtime to declare something. Thanks to comment syntax this works as well
const Enum = /*::Object.freeze(*/{ X: 'x', Y: 'y', }/*::);*/ type EnumT = $Values<typeof Enum> ('a': EnumT); // Fails
Sorry, something went wrong.
I guess this can be closed in favor of #627
/cc @vkurchatkin
No branches or pull requests
The latest flow release shows the following example:
Is it possible to do this without the run-time
Object.freeze()
? This raises browser-support and performance concerns.I tried this but it didn't work:
How can I mark the
Enum
as being frozen, without usingObject.freeze
?The text was updated successfully, but these errors were encountered: