A complete, working template demonstrating all YpsilonEventHandler patterns. Perfect starting point for any project.
Just remove what you don't like and start from there.
Ypsilon Team
ZERO of these buttons have event listeners attached to them!
We have ONE click listener on the <body>
element that controls
ALL buttons on this page. New buttons added dynamically?
Still work instantly, because for the listener nothing has changed, it's still the same element it's listening to - no re-assignment needed!
YpsilonEventHandler includes a powerful dispatch()
method for custom events.
Press any key while focused on this page to see keydown events in the console.
Resize the window or scroll to see throttled events in the console.
Reactive state management with automatic UI updates using data-state
attributes.
Click count: 0
Last key pressed: none
Current input: empty
Window size: 0x0
State updates automatically sync across all data-state
elements!
Scroll content for testing scroll events