View m.Portal.js
const Portal = {
view : ({attrs, content = []}) =>
attrs.view({
outlet: () =>
content,
inlet: (...input) => {
content.splice(0, Infinity, ...input)
},
})
View serialized-model-logic.js
const endOfTime = '9999-12-31'
const conditions = [
{
demographic: {
gender: 'female',
dob: '1954-10-06',
},
retirement: {
View cssVars.js
const cssVars = (target = document.documentElement, key, value) => (
key == null
? [...target.style].reduce((hash, key) => hash.slice(0,2) != '--' ? hash : Object.assign(hash, {
[key.slice(2)] : target.style.getPropertyValue(key)
}), {})
: typeof key == 'object'
? Object.entries(key).forEach(entry => {
cssVars(target, ...entry)
})
: value == undefined
View weil.js
export default iterator =>
function * (cursor) {
while(cursor = iterator(cursor))
cursor = yield(cursor)
}
}
View patchinko.js
export {patch, scope}
function patch(a, b){
for(var key in b)
if(b.hasOwnProperty(key))
a[key] = (
b[key] instanceof scope
? scope.apply(a[key])
: b[key]
)
View range_selection_caret.js
dom.focus()
const range = document.createRange()
range.setStart(selection.anchorNode.nextSibling.nextSibling, 0)
range.collapse(true)
selection.removeAllRanges()
selection.addRange(range)
View package.json
{
"scripts": {
"start": "server.js"
}
}
View Spanner.jsx
export default const Spanner = ({ children = '', split = /\b/ }) =>
<span className="spanner">
{[].concat(children).map(string =>
string.split(split).map(substring =>
<span className={/^\s*$/.test(substring) ? 'whitespace' : 'word'}>
{substring}
</span>
)
)}
</span>
View conditional_fragment.jsx
import React from 'react';
import Input from './Input.js';
const InputGroup = props => (
<div>
{props.inputHasLabel &&
<label
htmlFor={props.inputName}
className="label"
>
View unfuckReact.js
const mounted = new WeakSet()
export default const unfucker = (component, displayName = component.displayName || component.name || 'React.Component') => {
const host = {
[displayName] : class extends React.Component {
constructor(){
this.state = {}
component.apply(this, arguments)
}