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
There would be two options for the signal() signature:
@signal accessor foo for non-options usage and @signal({...}) accessor foo for options usage.
@signal() accessor foo for non-options usage and @signal({...}) accessor foo for options usage.
(2) is possible by duck-typing the arguments.
I personally prefer style (2) for consistency, but there's also consistency to consider with the other decorators. I guess @cached could accept options as well, since it's basically a wrapper for new Signal.Computed().
The text was updated successfully, but these errors were encountered:
Oops... I meant to say that I prefer option (2)! I found that a lot of decorators take options, so always having the () after the decorator provides visual consistency. It also makes it easier to add options in the future even if a decorator doesn't take them now.
@signal
is a wrapper fornew Signal.State()
but it does not expose the options argument.It should be possible to do:
There would be two options for the
signal()
signature:@signal accessor foo
for non-options usage and@signal({...}) accessor foo
for options usage.@signal() accessor foo
for non-options usage and@signal({...}) accessor foo
for options usage.(2) is possible by duck-typing the arguments.
I personally prefer style (2) for consistency, but there's also consistency to consider with the other decorators. I guess
@cached
could accept options as well, since it's basically a wrapper fornew Signal.Computed()
.The text was updated successfully, but these errors were encountered: