re: Why I use Web Components - My use cases VIEW POST

FULL DISCUSSION
 

Great write-up. Here's an example of your counter component written using hybrids. Devs might choose hybrids if they are looking to factor an app with a (mostly-)functional, highly composable component model.

import { define, html } from 'hybrids';

const inc = host => host.count += 1;

const MyCounter = {
  count: 0,
  render: ({count}) => html`
     <label for="button">${count}</label>
     <button id="button" onclick="${inc}">Increment</button>
  `
};

define('my-counter', MyCounter);
 

I didn't know that I have an ambassador of the project :) It so cool to see that other people uses your work.

code of conduct - report abuse