- Create actions similar to Flummox.
- Generate action ids.
- Supports actions with promises, and therefore ES7 async.
// Webpack config file | |
var BrowserSyncPlugin = require('browser-sync-webpack-plugin'); | |
module.exports = { | |
entry: './assets/js/components/Index.jsx', | |
output: { | |
path: __dirname + '/assets/js', | |
filename: 'bundle.js' | |
}, | |
module: { |
function fromEvent(dom, eventName) { | |
return { | |
forEach: function(observer) { | |
var handler = (e) => { | |
observer.onNext(e); | |
}; | |
dom.addEventListener(eventName, handler); | |
// Subscription | |
return { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> | |
<title>Test Page</title> | |
<script> | |
// early compute the vw/vh units more reliably than CSS does itself | |
computeViewportDimensions(); |
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
Manual super: Alternative Design where subclass constructors do not automatically call superclass constructors
This Gist presents a new design of class-based object construction in ES6 that does not require use of the two-phase @@create protocol.
One of the characteristics of this proposal is that subclass constructors must explicitly super invoke their superclass's constructor if they wish to use the base class' object allocation and initialization logic.
An alternative version of this design automatically invokes the base constructor in most situations.
const I = x => x | |
const K = x => y => x | |
const A = f => x => f (x) | |
const T = x => f => f (x) | |
const W = f => x => f (x) (x) | |
const C = f => y => x => f (x) (y) | |
const B = f => g => x => f (g (x)) | |
const S = f => g => x => f (x) (g (x)) | |
const S_ = f => g => x => f (g (x)) (x) | |
const S2 = f => g => h => x => f (g (x)) (h (x)) |
import React from 'react'; | |
const MIN_SCALE = 1; | |
const MAX_SCALE = 4; | |
const SETTLE_RANGE = 0.001; | |
const ADDITIONAL_LIMIT = 0.2; | |
const DOUBLE_TAP_THRESHOLD = 300; | |
const ANIMATION_SPEED = 0.04; | |
const RESET_ANIMATION_SPEED = 0.08; | |
const INITIAL_X = 0; |