import { html, render } from 'lit'
import { provide, connect } from './unlit'
const app = provide(store)( () => html`<div>${counter}</div>` )
const counter = connect('count', {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
aliases = config --get-regexp '^alias\\.' | |
br = branch | |
branch-name = rev-parse --abbrev-ref HEAD | |
ci = commit -m | |
cm = !git add -A && git commit -m | |
co = checkout | |
cb = rev-parse --abbrev-ref HEAD | |
cob = checkout -b | |
cl = checkout - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"lerna": "2.11.0", | |
"version": "independent", | |
"npmClient": "yarn", | |
"useWorkspaces": true, | |
"command": { | |
"publish": { | |
"allowBranch": "master" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type Cancel = void | ((k: (r: void) => void) => void) | |
export const runCancel = (c: Cancel, k: (r: void) => void): void => | |
c ? c(k) : k() | |
export type Fx<H, A> = (handler: H, k: (a: A) => void) => Cancel | |
export type Pure<A> = Fx<{}, A> | |
export const handle = <H0, H1, A>(fx: Fx<H0 & H1, A>, h1: H1): Fx<H0, A> => | |
(h0, k) => fx({ ...h0, ...h1 } as H0 & H1, k) |
Photo by Ricardo Gomez Angel on Unsplash
This gist is a collection of common patterns I've personally used here and there with Custom Elements.
These patterns are all basic suggestions that could be improved, enriched, readapted, accordingly with your needs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-unused-vars */ | |
/* eslint-disable no-else-return */ | |
// JSX constructor, similar to createElement() | |
export const h = (type, props, ...children) => { | |
return { | |
type, | |
// Props will be an object for components and DOM nodes, but a string for | |
// text nodes | |
props, |
OlderNewer