Skip to content
New issue

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

useSymbolFunctionStore #4

Open
souldreamer opened this issue Sep 8, 2021 · 1 comment
Open

useSymbolFunctionStore #4

souldreamer opened this issue Sep 8, 2021 · 1 comment

Comments

@souldreamer
Copy link
Collaborator

Is this superseded by issue #3 ?
If it's not, you should definitely give up on Symbols, it's not like you use them as actual Symbols, given the fact that they have a 1-to-1 relationship to a string and you only use Symbol.for to generate the objects. So they're effectively used as strings and could be changed to that with no issue.

@Sawtaytoes
Copy link
Owner

Sawtaytoes commented Sep 8, 2021

#3 is different and related to how custom hooks wire into each other in the OneForm component. I'd really want to clean up how inter-twined everything's become in there.


I can't remember exactly why I used symbols instead of strings, but I know I had a reason for it because I remember thinking how it solved a problem.

There was something about two group validations sharing the same identifies in different validation groups, but that doesn't make sense if I'm using Symbol.for.

There was also something about being able to lookup the symbol by the string from multiple hooks, but then why not use strings instead?

Is symbol equivalency faster? That's a micro-optimization I wouldn't care to keep.

If we can safely remove symbols because they're using Symbol.for, let's get rid of them. It would remove the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants