(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
After listening to the latest Magic Read-along episode "You should watch this" (which you should go listen to now) I got
caught up thinking about Brian's idea of an Endomorphism version of Kleisli composition for use with Redux,
it's actually a very similar model to what I'm using in my event
framework for event listeners so I figured I'd try to formalize the pattern and recognize
some of the concepts involved. IIRC Brian
described the idea of a Redux-reducer, which is usually of type s -> Action -> s
, it takes a state and an action and returns
a new state. He then re-arranged
the arguments to Action -> s -> s
. He then recognized this as Action -> Endo s
(an Endo
-morphism is just any function
from one type to itself: a -> a
).
He would take his list of reducers and partially apply them with the Action
, yielding a list of type Endo s
where s
First and foremost a coding screencast is about the code, and we need to make sure it looks great. There are a few aspects to this that help ensure that is the case.
720p is the target resolution. In pixel terms this is 1280x720. We've gotten the best results when we record at 2560x1440 in a HiDPI (pixel double) mode, giving an effective visible resolution of 1280x720, but extremely crisp. This resolution is achievable on 27" monitors and retina MBPs.
// shorthand function for the Number.isInteger method | |
const isInt = Number.isInteger | |
// shorthand function for the Array.isArray method | |
const isArray = Array.isArray | |
// functional wrapper for the Array.reduce method | |
const reduce = f => initVal => arr => arr.reduce(f, initVal) | |
// functional wrapper for the Array.concat method |
import compose from 'ramda/src/compose' | |
import equals from 'ramda/src/equals' | |
import filter from 'ramda/src/filter' | |
import head from 'ramda/src/head' | |
import length from 'ramda/src/length' | |
import map from 'ramda/src/map' | |
import min from 'ramda/src/min' | |
import not from 'ramda/src/not' | |
import sort from 'ramda/src/sort' | |
import split from 'ramda/src/split' |
import all from 'ramda/src/all' | |
import chain from 'ramda/src/chain' | |
import compose from 'ramda/src/compose' | |
import contains from 'ramda/src/contains' | |
import curry from 'ramda/src/curry' | |
import equals from 'ramda/src/equals' | |
import filter from 'ramda/src/filter' | |
import flip from 'ramda/src/flip' | |
import join from 'ramda/src/join' | |
import map from 'ramda/src/map' |
An introduction to functional thinking with examples in JavaScript.
https://medium.com/@chetcorcos/functional-programming-for-javascript-people-1915d8775504#.p0hyzlyjq
A soft, informal introduction to the Fantasy Land spec.
https://james-forbes.com/?/posts/the-perfect-api
// write a function to find all content items of a specific type | |
// under a specific topic, where a "topic" could be a top-level | |
// subject, a subcategory of that subject, or a particular concept | |
// falling under that subcategory | |
// possible example data structure | |
const EDUCATION_DATA = { | |
math: { | |
arithmetic: { | |
subtraction: { |
Douglas Crockford, author of JavaScript: The Good parts, recently gave a talk called The Better Parts, where he demonstrates how he creates objects in JavaScript nowadays. He doesn't call his approach anything, but I will refer to it as Crockford Classless.
Crockford Classless is completely free of class, new, this, prototype and even Crockfords own invention Object.create.
I think it's really, really sleek, and this is what it looks like:
function dog(spec) {