https://www.lucidchart.com/invitations/accept/d77e6095-bd82-41af-a9cf-a48e056f39ee
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
// quick sketch | |
/** | |
* Contextual piping | |
* @todo create a method to mimic a piping operator | |
*/ | |
const pipe = function() { | |
let res | |
for ( let i = 0; i < this.length; i++ ) { |
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
# Isolated Development Environment Installation | |
# Poor man's storybook for scripts, with glitch | |
# https://www.lucidchart.com/invitations/accept/d77e6095-bd82-41af-a9cf-a48e056f39ee | |
# tl;dr | |
# Problem: | |
# `return _cache( new Symbol( key ) )` should have been `return ( typeof key === 'Symbol' ) ? _cache( key ) : _cache( new Symbol( key ) ) |
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
// an alternative to traversal | |
// https://github.com/matthewstokeley/dom-traversal | |
// @version 0.0.3 | |
_.castArr = function( | |
list: NodeList | |
): Array { | |
return Array.prototype.splice.call( list ) | |
} |
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
/*> Click Handler Middleware */ | |
// @version 0.0.3 | |
// CHANGELOG | |
// 0.0.3 add type scaffolding | |
type Next = function():void {} | |
interface Target { |
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
// dom versus publisher subscribe naming conventions | |
const Handler = ( function() { | |
return {} | |
} )() | |
type eventName: String | |
type eventFn: Function |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"outDir": "./dist/", | |
"sourceMap": true, | |
"noImplicitAny": true, | |
"module": "commonjs", | |
"target": "es6", | |
"jsx": "react" | |
} | |
} |
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
// RDD-inspired replication with node | |
const createQueue (nodeServices) => { | |
const q = new Set() | |
for (var value of nodeServices) { | |
q.add(value) | |
} | |
return q; | |
} |
This is one possible example of object-based prototypal inheritance,
using hasOwnProperty
to break the prototype chain.
const _createElement = _proto => {
let _el = Document.createElement()
for (var prop of _proto) {
if (Object.hasOwnProperty(prop)) {
_el[prop] = _proto[prop]
}