View Blockem.js
const Blocker = () => {
const blockers = new Map
const register = v => {
if(v.attrs.blockers)
v.attrs.blockers.set(v.state, () =>
Promise.all(
['attrs', 'state']
.map(host =>
v[host].onbeforeremove
View diffm.js
export default (component, previous = undefined) => ({
...component,
onbeforeupdate: (a, b) => (
component.onbeforeupdate
&&
component.onbeforeupdate(a, b) !== false
&&
previous = b
),
View domicile.js
import m from 'mithril'
const find = predicate => generator => {
for(const item of generator)
if(predicate(item))
return item
}
const horizontalElementQuery = function * (root = document){
const backlog = []
View pave.js
const pave = (container, target, path = []) => (
container === target
?
path
:
Array.isArray(container)
?
container.filter((a, i) => pave(a, target, [...path, i])).pop()
:
container.instance
View overloaded-patchinko.js
export default function O(a){
return (
arguments.length == 1
?
typeof a != 'function'
?
new O(a => O(b, a))
:
this instanceof O
?
View m.inline-refs.js
const login = {
view : ({state}) =>
m('form#login', {
onsubmit: e => {
e.preventDefault()
console.log(
state.email.dom.value,
state.pass.dom.value,
)
View thinkpol.js
export const censored = $ =>
$ == undefined || $ === false ? '' : $
export const censor = ({ censored, strings, expressions }) =>
strings.reduce((a, c, i, [], b = expressions[i - 1]) =>
a + censored(b) ? '' : b + c
)
export default (strings, ...expressions) =>
Array.isArray(strings)
View README.md

Usage:

import kv from 'kv'

const {
  SOME,
  CONSTANTS,
  FOR_INTERNAL_USE,
} = kv(Symbol)
View README.md
import on from 'on.js'

async function royalAirForce(){
  await on(requestAnimationFrame)

  renderX()
  
  await on(requestAnimationFrame)
View patchem.js
// You can't proxy function application onto objects :/
import {O} from 'patchinko'
const Patchem = def =>
O({}, def, [{}, 'oninit', 'onbeforeupdate'].reduce((patch, key) =>
O(patch, {
[key](node){
O(node, {
state : new Proxy(v.state, {