-
Notifications
You must be signed in to change notification settings - Fork 18k
syscall/js: the name "Callback" does not fit to all of its use cases #28711
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
Comments
Summary: I like This is a surprisingly difficult issue to nail down. Lots of things are in play: Ease of usage of documentation, point of view, being accurate, and being succinct, to name a few.
All of that leads me to prefer |
I like I like |
I'm not great when it comes to naming things 😄
cc @bradfitz for some better name ideas |
@myitcv So you don't like |
I prefer
which would then be used as |
Ohh, I like this |
What does But this got me thinking: The problem around
So maybe we can have |
Change https://golang.org/cl/153559 mentions this issue: |
Change https://golang.org/cl/154059 mentions this issue: |
Updates #28711 Change-Id: I03139a394fdf0540db07d6d1e38b3fa223b06d58 Reviewed-on: https://go-review.googlesource.com/c/154059 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Wikipedia says:
This does not apply to all use cases of
js.Callback
, for example it may be used to register an event listener.In #26045 the alternative names
js.Callable
andjs.Function
have been suggested. Whilejs.Function
seems like the simplest name, it suffers from being too common, so the documentation becomes hard to read because the term "function" does not only identifyjs.Function
.If we want to change the name, we should do so for Go 1.12 because the signature of
js.NewCallback
already got changed in this cycle, so we should do this breaking change in the same cycle.(
syscall/js
is experimental and exempt from Go's compatibility promise)The text was updated successfully, but these errors were encountered: