This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<script src="//fb.me/react-0.12.2.js"></script> | |
<script src="//fb.me/JSXTransformer-0.12.2.js"></script> | |
<script type="text/jsx" src="example1.jsx"></script> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
React.createElement("div", null, | |
React.createElement(MyLabel, {text: TextLabel}), | |
React.createElement(MyTextfield, null), | |
React.createElement(MyButton, {textlabel: "OK"})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<MyLabel text={TextLabel} /> | |
<MyTextfield /> | |
<MyButton textlabel='OK' /> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"kind": "youtube#searchResult", | |
"etag": "\"m2yskBQFythfE4irbTIeOgYYfBU/QpOIr3QKlV5EUlzfFcVvDiJT0hw\"", | |
"id": { | |
"kind": "youtube#channel", | |
"channelId": "UCJowOS1R0FnhipXVqEnYU1A" | |
}, | |
"snippet":{ | |
"publishedAt":"2013-01-25T13:36:19.000Z", | |
"channelId":"UCpVm7bg6pXKo1Pr6k5kxG9A", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"kind": "youtube#searchResult", | |
"etag": "\"m2yskBQFythfE4irbTIeOgYYfBU/QpOIr3QKlV5EUlzfFcVvDiJT0hw\"", | |
"id": { | |
"kind": "youtube#channel", | |
"channelId": "UCJowOS1R0FnhipXVqEnYU1A" | |
}, | |
"snippet":{ | |
"publishedAt":"2013-01-25T13:36:19.000Z", | |
"channelId":"UCpVm7bg6pXKo1Pr6k5kxG9A", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
export class User { | |
id: number; | |
name: string; | |
username: string; | |
avatar: string; | |
} | |
const users: User[] = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.UglifyJsPlugin({ | |
mangle: true, | |
compress: { | |
warnings: false, // Suppress uglification warnings | |
pure_getters: true, | |
unsafe: true, | |
unsafe_comps: true, | |
screw_ie8: true | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
var path = require('path'); | |
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | |
var BUILD_DIR = path.resolve(__dirname, 'public/scripts'); | |
var APP_DIR = path.resolve(__dirname, 'app'); | |
var config = { | |
entry: { | |
app: [path.join(__dirname, 'app/app.js')], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shouldComponentUpdate (nextProps) { | |
// have any of the items changed? | |
if(!isArrayEqual(this.props.items, nextProps.items)){ | |
return true; | |
} | |
// everything from here is horrible. | |
// if interaction has not changed at all then when can return false (yay!) | |
if(isObjectEqual(this.props.interaction, nextProps.interaction)){ | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isObjectEqual = (obj1, obj2) => { | |
if(!isObject(obj1) || !isObject(obj2)) { | |
return false; | |
} | |
// are the references the same? | |
if (obj1 === obj2) { | |
return true; | |
} |