Frontend Masters Boost RSS Feed https://frontendmasters.com/blog Helping Your Journey to Senior Developer Fri, 08 Dec 2023 17:27:30 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 225069128 Invokers https://frontendmasters.com/blog/invokers/ https://frontendmasters.com/blog/invokers/#respond Thu, 23 Nov 2023 20:44:16 +0000 http://fem.flywheelsites.com/?p=160 Keith Cirkel demonstrates a brand new concept (requires Chrome Canary and the Experimental Web Platform Features flag right now) called Invokers, a proposal from the Open UI group that is polyfillable. You “invoke” events directly on a specific element in the DOM:

<button
  invoketarget="counter"
  invokeaction="increment"> + </button>

<h1 id="el">0</h1>

Then you can listen for the invoke event on that element.

el.addEventListener("invoke", (e) => {
  console.log(e.action); // increment
  // do stuff
});

Adding interactive functionality to HTML attributes seems to be aligned with the last decade of JavaScript frameworks.

]]>
https://frontendmasters.com/blog/invokers/feed/ 0 160