You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use your library, yet I do not see any code dealing with events.
I could register events on the container, however I believe that it is preferable to have the option of registering events on all elements.
I am sure there are different strategies to deal with events.
Maybe the simplest and most flexible option is to have an additional optional parameter on the hyperscript function (el()), it would be a function, and this function gets called every time the HTML element corresponding to that vnode gets modified, or created.
Basically like "lifecycle events" for HTML elements which are managed by SVD.
So for example:
el('a', {'href':'#something'}, null, function(element, lifecycleEvent){
if(lifecycleEvent == 'created') {
// the HTML element for this vdom node was just created, add event listeners
element.addEventListener('click', function(){
// attach an event listener
});
}
});
We can then build on this functionality to do more complicated things if needed.
The text was updated successfully, but these errors were encountered:
I would like to use your library, yet I do not see any code dealing with events.
I could register events on the container, however I believe that it is preferable to have the option of registering events on all elements.
I am sure there are different strategies to deal with events.
Maybe the simplest and most flexible option is to have an additional optional parameter on the hyperscript function (el()), it would be a function, and this function gets called every time the HTML element corresponding to that vnode gets modified, or created.
Basically like "lifecycle events" for HTML elements which are managed by SVD.
So for example:
We can then build on this functionality to do more complicated things if needed.
The text was updated successfully, but these errors were encountered: