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, {
View columnity.js
const $spans = [...document.querySelectorAll('*')]
.map($ =>
[...$.childNodes].filter($ =>
$.nodeType === 3
)
)
.reduce((a, b) =>
[...a, ...b]
)
.map(textNode => {
View call.js
export default Function.prototype.call.bind(Function.prototype.call)
View possibly.js
const [not, definitively] = [Symbol(), Symbol()]
export default const possibly = possibility => premise => alternatively =>
[premise, ...possibility, definitively].reduce((premise, postulate) =>
premise === not
?
alternatively
:
postulate === definitively
?
View RANT.js.md
  • For something to merit a name, it must be used in at least 2 places.
  • Favour operations, avoid keywords.
  • Some punctuation is semantically essential (||, ?, !), some is only arguably useful sometimes ({, ;). Favour the first, avoid the second when you can.
  • ☝️ Parentheses are the exception. ( is brilliant, so is ,. Use them eagerly!