Skip to content
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

Support for function callbacks as properties #9

Open
kurienzach opened this issue Nov 21, 2019 · 1 comment
Open

Support for function callbacks as properties #9

kurienzach opened this issue Nov 21, 2019 · 1 comment

Comments

@kurienzach
Copy link

First of all kudos to the awesome work.

In the organization that I work for, we have a widget library developed as LitElements. We don't use events much but use functions as properties inside the LitComponent. Currently, this code assumes that all props which are functions should be event handlers. But in our case, some functions need to be set as properties.

@jimthedev
Copy link

Hey @kurienzach!

I am working on a different (albeit similar) hook was wondering how you would like to make the distinction between functions that you want added as a handler and those that you just want as a prop.

Just to give an example, Angular will generally create a handler if you use (mouseleave) but not if you use mouseleave (it passes it through as a prop).

Initially I was thinking you could use a pattern like onMouseLeave (on followed by uppercase) to mean you want a handler and anything else, like mouseLeave to be a prop. Would that work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants