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
The parameter of singal()
can be omitted, just like useState()
.
#532
Comments
I don't think it's a problem. Better to keep function with the same amount of arguments (it's better for performance) |
Even if you're right, but the class |
Looks reasonable to me, if you want to PR it. |
Anyway I think it should be benchmarked. Check for deoptimizations and how much it slows other benchmarks |
This should be a type signature-only change. There will be no effect on the benchmarks |
@XantreGodlike This is in relation to an already allowed paradigm, signals can be initiated with undefined or a missing initializer as you yourself link to for the |
It's not we are starting to provide interface that allows different amount of args. It can cause performance slow down, depending on usage |
But probably impact will be insignificant |
Did you read my comment? It's already |
We are not. This usage has always been valid. I don't think that benchmark is displaying what you think it is. Trying to do math with |
Got it. Sorry |
Think about this, create a issue signal, and it's initial is undefined, then you should pass
undefined
to both generic parameter and function parameter.We can see that it leads to boilerplate code and the development experience is reduced.
The
signal()
can be defiened like this:The text was updated successfully, but these errors were encountered: