This file contains 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 default class Table { | |
constructor(fields){ | |
this._is = a => b => | |
fields.every(field => a[field] === b[field]) | |
} | |
_entries = [] | |
get size(){ | |
return this._entries.length |
This file contains 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
import reflow from './reflow.js' | |
const startEvents = ['animationstart', 'transitionrun'] | |
const endEvents = ['animationcancel', 'animationend', 'transitioncancel', 'transitionend'] | |
export default function Presence({attrs: { | |
absent, | |
present, | |
entry, | |
exit, |
This file contains 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
const noop = () => {} | |
const elementHandler = { | |
get: (element, key) => { | |
if(key === 'setAttribute') | |
return noop | |
if(key === 'style') | |
return { | |
setProperty : noop, |
This file contains 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 default function matrix(keys){ | |
return subject => ( | |
Array.isArray(subject) | |
? | |
Object.fromEntries( | |
keys.flatMap((key, index) => | |
key == null ? [] : [[key, subject[index]]] | |
) | |
) | |
: |
This file contains 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 default function split(subject, visitor){ | |
const isArray = Array.isArray(subject) | |
const container = [] | |
void (isArray ? subject : Object.entries(subject)).forEach(function(entry){ | |
const division = visitor.apply(this, arguments) | |
if(!(division in container)) | |
container[division] = [] | |
This file contains 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
import { domOf, viewOf } from './_utils.mjs' | |
export default function Mobile() { | |
const creating = new Map | |
const removing = new Map | |
return { | |
view: v => | |
viewOf(v)(Unit), |
This file contains 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
// imort m from 'mithril' | |
export default Object.assign( | |
decorate(m), | |
m, | |
{ | |
fragment: decorate(m.fragment), | |
}, |
This file contains 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
const options = { | |
duration: 600, | |
easing: 'cubic-bezier(0, 0.55, 0.45, 1)', | |
fill: 'both', | |
} | |
function feedback(message = 'error'){ | |
const $circle = render(circle) | |
$circle.animate({ |
This file contains 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
import {viewOf, indexOf, domOf} from './utils.js' | |
export function EnsconcedIsland(v){ | |
let input | |
let index | |
let dom | |
return { | |
view: v => { | |
viewOf(v)({render, vnode, write}) |
This file contains 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
import {indexOf} from './utils.js' | |
export default function Island({children: [visitor]}){ | |
let index | |
let vnode | |
visitor({ patch, attach, render }) | |
return { | |
view(){ |