Skip to content

Instantly share code, notes, and snippets.

@henriklundgren
henriklundgren / .babelrc
Created January 4, 2016 07:57
Angular2 (classes and decorators) with Babel
{
"presets": [
"es2015"
],
"plugins": [
"angular2-annotations",
"transform-decorators-legacy",
"transform-class-properties"
]
}
@henriklundgren
henriklundgren / index.js
Last active November 11, 2015 16:15
React with Baobab
import React from 'react';
import ReactDOM from 'react-dom';
import {
branch,
root,
} from 'baobab-react/higher-order';
import Baobab from 'baobab';
const state = new Baobab({
title: 'Foobar',
@henriklundgren
henriklundgren / README.md
Last active February 28, 2017 08:30
React factory syntax

Easier way of writing React components is using factory functions as opposed to constructor functions. While I don't mind constructor functions I am absolutly persuaded by the critics of before-mentioned functions.

My top reason to prefer factories before constructors is because they reveal intention without the overhead of padding. Padding being the text that needs to be written before we reach our immediate goal.