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
Currently NodeType is only defined as a String
It can be great to have a constants / enum definition to avoid to hardcode their usage in our project, like this:
Yeah, I've definitely planned on doing this. I've been focusing on more of a breadth-first approach to working on the packages in this monorepo and so I haven't gotten around to doing this yet. See #530 for my immediate goals.
Feel free to make a PR for this yourself. If you don't make a PR, I'll get to it eventually, but it's not high on the list of priorities for me at the moment.
On a final note, I prefer string constants instead of enums since it's easier to define a subset of them as a new type and they feel closer to actual JS to me, but I'm not completely against an enum if that's how want to do it.
You're true
One advantage of the enum is you can ensure you will never pass a value not
allowed.
But a type alias like
type TNodeType = 'String' | 'Number' | ...
Is also a correct solution that can be extend and prevent the bad cases
Le mer. 28 oct. 2020 à 16:56, Nathan Bierema <notifications@github.com> a
écrit :
Yeah, I've definitely planned on doing this. I've been focusing on more of
a breadth-first approach to working on the packages in this monorepo and so
I haven't gotten around to doing this yet. See #530
<#530> for my immediate
goals.
Feel free to make a PR for this yourself. If you don't make a PR, I'll get
to it eventually, but it's not high on the list of priorities for me at the
moment.
On a final note, I prefer string constants instead of enums since it's
easier to define a subset of them as a new type, but I'm not completely
against an enum if that's how want to do it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#659 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIKMMOEAWMM4H3VPREGSFTSNA5JJANCNFSM4TCMKZNQ>
.
Currently NodeType is only defined as a String
It can be great to have a constants / enum definition to avoid to hardcode their usage in our project, like this:
I found these list of names by searching in your source code. even not sure I've found all the cases
The text was updated successfully, but these errors were encountered: