View stalling-list.1684.js
export default {
onbeforeupdate(now, then){
const keys = now.children.map(({key}) => key)
const departed = then.children.filter(({key}) => !keys.includes(key))
if(!departed.length)
return true
const departures = departed.map(vnode =>
View mRouteStream.js
import m from 'mithril'
import stream from 'mithril/stream/stream'
export default function routeStream(
defaultRoute = '/',
routes = ['/:path...']
){
const routeStream = stream()
m.route(
View HotComponent.js
const= new Map()
const queue = new Set()
let scheduled = false
function schedule(){
if(scheduled) return
scheduled = true
View m.sideEffects.js
export default function mSideEffects(lifecycle){
m.mount(document.createDocumentFragment(), Object.assign({
view : () => ''
},
lifecycle
))
}
View ancestors.js
export default function * ancestors({parentNode}){
if(parentNode){
yield parentNode
yield * ancestors(parentNode)
}
}
View vTreeWalker.js
export default function * vTreeWalker(vnode){
yield vnode
if(vnode.instance)
yield * vTreeWalker(vnode.instance)
else if(Array.isArray(vnode.children))
for(const child in vnode.children)
yield * vTreeWalker(child)
}
View Drag.js
import m from 'mithril'
import {stream} from 'flyd'
import PointerStream from 'pointer-stream'
// The component state object is provided wholesale for the author API, therefore we store our internal API state in a Map
const= new Map()
// Bind a temporal vnode to the private store associated with its persistent state
// This allows us to reliably access the last render's dom and attribute data
function update(vnode){
View mithril-displacer.js
const patch = (dom, now, then) => {
const host = document.createDocumentFragment()
const {domSize} = then
host.vnodes = then
for(
let i = 0, node = then.dom;
i < domSize;
i++, node = node.nextSibling
View matchHeights.js
const div = document.createElement('div')
const div_w0 = div.cloneNode()
const div_w100 = div.cloneNode()
const div_flex = div.cloneNode()
div_w0.style.marginRight = '-100%'
div_w0.style.visibility = 'hidden'
div_w0.style.width = '100%'
div_w0.setAttribute('aria-hidden', true)
View multiMap.js
function multiMap( keys ){
const lists = {}
keys.forEach( key => lists[ key ] = [] )
return {
set( entry ){
let index = lists[ keys[ 0 ] ].indexOf( entry[ keys[ 0 ] ] )
if( index < 0 ) index = lists[ key[ 0 ] ].length