-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add declarative way to set up observers and event listeners #1042
Comments
I think adding event listeners is super useful, as most event listeners I use in a component immediately call a method in |
@Rich-Harris Any updates here? I think this solution gives us the way to keep our oncreate hook is clean. |
If we implemented export default {
on: {
create() {
// setup
},
destroy() {
// setup
}
}
}; I like the |
@jacwright In Ractive all life-cycle hooks available like regular custom events. And able to be listened from the parent: <Widget on:init="..." /> |
Closing as this isn't applicable to Svelte 3 |
I think we really need to have a declarative way to set up observers and event listeners. It could be implemented just like Ractive does:
The text was updated successfully, but these errors were encountered: