-
Notifications
You must be signed in to change notification settings - Fork 295
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
selection.join() improvements #264
Comments
Thanks for the feedback, but I don’t want to change the API. |
So you're happy with the current API? Could you elaborate more? |
@pavelschon The motivations for the proposal are not clear.
Why? The only reason to change would be if you need to access
How so? What is the benefit? Also keep in mind that changing this API would be a breaking change, and keeping the old API as well would introduce more surface area to the library. This proposal does not seem to hold water IMO. |
How so? What is the benefit? It's already mentioned in the first post - if you pass doExit as 2nd positional argument, it will most likely cause a bug:
SInce JS does not support named arguments, then the only way to do it is to pass an object. |
And it is not a breaking change: you can call join() in 2 ways already:
What's the problem to add another API like:
? |
First of all, I'd like to thank for the
selection.join()
, it's a great improvement over traditional enter-update-exit pattern.However, I feel there's some space for improvements.
Using arrow functions are good only for the simple case like this:
When you need to do something more complex, you will probably have to use regular functions:
or even factor-out functions for readability:
One may not need doUpdate() and will write:
I propose the following syntax: pass functions in the object:
Passing functions in the object will prevent bugs and improve the readability.
The text was updated successfully, but these errors were encountered: