An event bus is a design pattern (and while we’ll be talking about JavaScript here, it’s a design pattern in any language) that can be used to simplify communications between different components. It can also be thought of as publish/subscribe or pubsub. The idea is that components can listen to the event bus to know when to do the things they do. For example, a “tab panel” component might listen for events telling it to change the active tab. … Read article “Let’s Create a Lightweight Native Event Bus in JavaScript”
The post Let’s Create a Lightweight Native Event Bus in JavaScript appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.
https://css-tricks.com/lets-create-a-lightweight-native-event-bus-in-javascript/
Accedi per aggiungere un commento
Altri post in questo gruppo
The @view-transition
at-rule has two descriptions. One is the commonly used navigation
descriptor. The second is types
, the lesser-known of the two, and one t
After 20 years since Andy Clarke first published his book about Multi-Column Layout in CSS, he's back to encourage a fresh look at CSS columns for enhanced readability and design flexibility.
<
When it comes to positioning elements on a page, including text, there are many ways to go about it in CSS — the literal position
property with corresponding inset-*
prope
I was reading through Juan’s recent Almanac entry for the @counter-style
at-rule and I’ll be darned if he didn’t uncover and unpack some extremely interesting things
Chris wrote about “Likes” pages a long while back. The idea is rather simple: “Like” an item in your RSS reader and dis