A story of over five years of coding told in five minutes
Dominik Lubański
import { html, define } from "hybrids";
function increaseCount(host) {
host.count += 1;
}
export default define({
tag: "simple-counter",
count: 0,
render: ({ count }) => html`
<button onclick="${increaseCount}">
Count: ${count}
</button>
`,
});
May 14 2018
import { store, define } from "hybrids";
const User = {
id: true,
firstName: "",
lastName: "",
[store.connect] : {
get: id =>
fetch(`/users/${id}`)
.then(res => res.json()),
},
};
define({
tag: "my-user",
user: store(User),
render: ({ user }) => ...,
});
August 2020
import { define, html, router } from "hybrids";
const Home = define({
[router.connect]: { stack: [...] },
tag: "my-app-home-view",
content: ({ ... }) => html`
<div>...</div>
`,
});
define({
tag: "my-app",
stack: router(Home),
render: ({ stack }) => html`
<main>${stack}</main>
`,
});
December 2021
import { define, html, localize } from "hybrids";
export default define({
tag: "my-element",
name: "",
render: ({ name }) => html`
<div>Hello ${name}!</div>
`,
});
localize("pl", {
"Hello ${0}!": {
message: "Witaj ${0}!",
},
});
April 2022
import { define, html } from "hybrids";
export default define({
tag: "my-element",
content: () => html`
<template
layout="row gap"
layout@768px="column gap:2"
>
<div layout="grow">...</div>
</template>
`
});
August 2022