-
Notifications
You must be signed in to change notification settings - Fork 22
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
update docs and message on template arrow and bind #126
base: master
Are you sure you want to change the base?
Conversation
sorry this got lost and went a bit stale. i've just read through it again and im wondering if we should actually word it differently. basically:
i think the same applies to both of these rules exist because if you can reference a method/function rather than passing one inline, its usually the better choice. for events, properties, etc. |
The behavior described with the current rule description is only true for event listeners. Afaict lit only auto-binds event listeners and not functions passed as properties. This difference in lits binding behavior has caused me (and others) quite a bit of confusion and has ultimately led me to always wrap function calls in an inline arrow to get consistent behavior. |
from a performance standpoint, yes. From a cleanliness standpoint and for consistency in the codebase this may be a whole different story I'm afraid... |
i think what im saying is the current docs are already unclear. these two rules are not to do with event listeners. they're just about passing references to functions rather than inlining them. this can be anything - properties, events, etc. if the current docs say its to do with auto-binding etc, thats the fault i think. both rules should be generic, purely about passing refs rather than inline functions, in any situation. as for cleanliness etc, its an opinionated rule, thats ok. we just have to make it clear in the docs that if you prefer inline arrow functions, don't use it. |
Oh I see now and yes, it is true that you should always try to pass the same value and not create new ones. |
Fixes #125 .
I've tried to improve that phrasing on messages and docs that I found confusing, but I am not a native speaker! Feel free to comment on inaccuracies!