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

Expose methods #70

Closed
bestwestern opened this issue Apr 4, 2022 · 2 comments
Closed

Expose methods #70

bestwestern opened this issue Apr 4, 2022 · 2 comments

Comments

@bestwestern
Copy link

Is this possible to do
image

That is, call the method of a Preact Component from 'outside'? ( https://stackoverflow.com/questions/39439085/custom-methods-of-web-components )

Use case: I am making a web component to display data and want to expose a 'dataWasUpdated' method that can be called.

@bestwestern
Copy link
Author

I am closing this issue - I don't think Web Components are 'supposed' to be able to do this :)

@wolfwithdances
Copy link

I think this is supposedly possible, as on web.dev:

The powerful thing about custom elements is that you can bundle tailored functionality with the element by defining properties and methods on the element definition. Think of this as a way to create a public API for your element.

Per #1, it does not seem like this is possible right now.

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