Skip to content

Instantly share code, notes, and snippets.

View matthewstokeley's full-sized avatar
🎯
Focusing

Matthew Stokeley matthewstokeley

🎯
Focusing
View GitHub Profile
@matthewstokeley
matthewstokeley / Cyclomatic complexity and lexical scope in JavaScript.
Created October 30, 2020 21:30
Cyclomatic complexity and lexical scope in JavaScript.
Cyclomatic complexity and lexical scope in JavaScript.
Arrow functions, the equivalent of prototypally-inherited invoked bound functions, and modules, specifically the implementation of the ECMA spec designed from the competition between AMD and Commonjs implementations, radically altered default practices for handling global namespace collisions, variable design considerations and mutation strategies. This progression to discrete functions and native encapsulation can be thought of in terms of the principle of reducing cyclomatic complexity. The depth of lexical record is reduced at every function invocation, the global namespace is obviated, reducing IIFE’s and revealing modules that increase scope depth, and design choices increase given immutable variable declaration to reduce closures - design systems utilizing revealing module-enabled chaining syntax and object-oriented prototypal JavaScript are unaffected. Cyclomatic complexity is considered detrimental in method design because of memory constrain
@matthewstokeley
matthewstokeley / event-driven-jQuery-task-complétion.md
Created October 18, 2020 19:16
event-driven-jQuery-task-complétion.md
@matthewstokeley
matthewstokeley / Landing-page-onesheet.md
Created October 16, 2020 19:23
Landing page onesheet
@matthewstokeley
matthewstokeley / object-mutator-for-event-driven-data-mapping.js
Last active September 29, 2020 12:12
an object mutator for functional, compositional event-based data mapping with dependency injection and closures
// an object mutator for a functional, compositional event-based data mapper with closures
const store = {}
const shallowCloneObject = store => Object.assign({}, store)
// const store = shallowCloneObject(original)l
function defineProperty (
object: Object,
Stateful strategies in HTTP applications
Http applications
- Mobile
- Js apps
- Server-side
- Hybrid
- API’s
Persistence
@matthewstokeley
matthewstokeley / data-model.md
Last active April 29, 2020 14:22
data model writeup

The data model for data-binding

Data models contain the entirety of application state (from the elm-lang guide - "The point of the model is to capture all the details about your application as data." )

An Object Literal

A model could be as simple as a plain javascript object

@matthewstokeley
matthewstokeley / key-lookup-strategies.js
Last active April 28, 2020 14:49
Key Lookup Strategies
// 0.0.2
type Key: Symbol | String
type KeyClosure: Function( str: String ): Key
// Symbol Strategy
export var symbolKeyHandler = function symbolKeyHandler(
_cache: Function
): KeyClosure {
/**
* ------------------------------------------------------------------------
* events.js
*
* ------------------------------------------------------------------------
* a publish/subscribe events object
*/
( function() {
@matthewstokeley
matthewstokeley / single-threaded-processing-in-5-seconds.md
Last active April 16, 2020 00:08
Single-threaded-processing-in-5-seconds.md
// the thread of a processor is like a queue
- - - - -
// processes take various amounts of time to execute
--- -- - ------- -
@matthewstokeley
matthewstokeley / javascript-modules-in-5-seconds.md
Last active April 16, 2020 00:08
javascript-modules-in-5-seconds.md

wip needs editing

// Google Closure Library
google.require()
// ES6 Modules
import {export} from 'module'
// all