Factories
Example
import { property } from "hybrids";
function titleFactory(defaultValue, defaultTitle = '') {
return {
...property(
defaultValue,
/* connect */
(host, key) => {
if (host[key] === undefined) {
document.title = defaultTitle;
}
},
),
observe(host, value) {
document.title = value;
},
};
}Built-in Factories
Last updated
Was this helpful?