Skip to content

Instantly share code, notes, and snippets.

/** @jsx React.DOM */
// NOTE: This file is formatted for React.js + Browserify
// You might need to make some changes to use it without Browserify
var MousetrapMixin,
Mousetrap = require('br-mousetrap');
MousetrapMixin = {
var p1, p2, tp1;
// p1 is original promise
p1 = new Promise(function(resolve, reject){
setTimeout(function(){
console.log('+ resolve to hello');
resolve("hello");
}, 1000)
});

Keybase proof

I hereby claim:

  • I am alvinsj on github.
  • I am alvinsj (https://keybase.io/alvinsj) on keybase.
  • I have a public key whose fingerprint is B995 753B 6198 B0ED 48B6 B762 E0B0 9456 C027 0707

To claim this, I am signing this object:

import React from 'react';
import FormWithLayout from 'react-form-with-layout';
import {formInputsSerialize} from 'form-input-serialize';
const Form = (props) => {
const layout = (builder) => {
const {layout, section} = builder;
const col = (type, ...children) => builder.col(`col-${type}`, ...children);
return layout(
@alvinsj
alvinsj / advanced-react-free.md
Last active December 4, 2017 09:25
Review of the videos from Advanced React (Free version)

https://courses.reacttraining.com/courses/advanced-react-free

  1. Imperative vs. Declarative, "extending" React
    Making use of react lifecycle to make declarative API (from imperative lib). non-dom, nothing-to-render component. e.g. <Sound />, <Tone />, <D3 />

    • nice: declarative > imperative.
    • maybe? component tree with non-DOM component. e.g. sound(LifeCycleComponent, {isPlaying, pitch, frequency})
  2. Implicit State with Compound Components and cloneElement
    Making use of React.Children.map to inject props to children,