- plain ol' React
let state = initial
render(view(state), element)
view
is pure!
import isPlainObject from 'is-plain-object'; | |
export const keys = Object.keys; | |
export const assign = Object.assign; | |
export const merge = (...args) => assign({}, ...args); | |
export const reduceObj = (cb, obj = {}) => { |
import React from 'react' | |
import warning from 'warning' | |
const { number, object } = React.PropTypes | |
const WindowScrollTo = React.createClass({ | |
contextTypes: { | |
windowScrollTo: object | |
}, |
if (typeof Promise === 'undefined') { | |
require.ensure([], (require) => { | |
require('imports?this=>window!es6-promise') | |
}) | |
} | |
if (typeof fetch === 'undefined') { | |
require.ensure([], (require) => { | |
require('imports?self=>window!whatwg-fetch') | |
}) |
/*eslint-env es6 */ | |
// Inspired by the paper "A tutorial on the universality and | |
// expressiveness of fold" by Graham Hutton (available at | |
// http://www.cs.nott.ac.uk/~gmh/fold.pdf), implementing some generic | |
// list handling functions in JavaScript in terms of `fold`. | |
// Personally I had an enlightnening moment when I realised the | |
// beautiful interplay of cons lists and foldr during the FP101x | |
// Haskell course. JavaScript's syntax doesn't make this very apparent |
/** @jsx hJSX */ | |
import {hJSX} from '@cycle/dom'; | |
const DIALOGUE_NAME = `dialogue`; | |
let idSuffix = 0; | |
function makeCycleId() { | |
return `${DIALOGUE_NAME}-${idSuffix++}`; |
This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.
In that post I talked about 3 main reasons for moving from require.js to webpack:
Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.
// please comment if you know of other BOOKS (not considering blogs just yet) on ES6 that are out or coming out
States. The final frontier. These are the voyages of an enterprising developer. Her eternal mission: to explore strange new techniques, to seek out better ways to engineer for mental models and new design patterns. To boldly go where a few awesome devs have gone before.
So you’ve found our poignant guide to SCXML and surely you’re wondering “Why should I want to go out of my way to use formal state machines?” or something like that. Hopefully this introduction addresses that kind of question.
// array utils | |
// ================================================================================================= | |
const combine = (...arrays) => [].concat(...arrays); | |
const compact = arr => arr.filter(Boolean); | |
const contains = (() => Array.prototype.includes | |
? (arr, value) => arr.includes(value) | |
: (arr, value) => arr.some(el => el === value) |