This file contains 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
function* getStockValue() { | |
var entry1 = yield request('http://myrl.com/stock/key'); | |
var data1 = JSON.parse(entry1); | |
var entry2 = yield request('http://myurl/stock/value'); | |
var data2 = JSON.parse(entry2); | |
} |
This file contains 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
getJSON(url, function(response) { | |
getJSON(url, function(response) { | |
console.log(response); | |
}); | |
}); |
This file contains 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
export function createConstants(...constants) { | |
return constants.reduce((acc, constant) => { | |
acc[constant] = constant; | |
return acc; | |
}, {}); | |
} |
This file contains 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 {createReducer} from '../../utils'; | |
// Add the following for IE compatability | |
Object.assign = Object.assign || require('object-assign'); | |
const initialState = { | |
'count': 0, | |
'receiving': false, | |
'pages': 0, | |
'documents': [] | |
}; |
This file contains 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 renderIf from '../utils/renderif' | |
export default class RenderIfExample extends Component { | |
render() { | |
var isTrue = true; | |
return ( | |
<div> | |
{renderIf(isTrue)( | |
<h1>I am being rendered</h1> |
This file contains 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
export default class BindFunctionExample extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
hidden: true, | |
}; | |
this.toggleHidden = this.toggleHidden.bind(this); | |
} | |
toggleHidden() { |
This file contains 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
"scripts": { | |
"eslint": "eslint", | |
"lint": "eslint --config .eslintrc.json --format compact .", | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"build": "webpack --debug", | |
"buildProduction": "webpack --progress -p", | |
"deployMac": "./build_helpers/buildDist.sh", | |
"deployWin": "./build_helpers/buildDist.exe", | |
"dev": "webpack-dev-server --content-base src --inline --hot", | |
"devhttps": "webpack-dev-server --content-base src --inline --hot --https", |
This file contains 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
set -e | |
PATH=$(npm bin):$PATH | |
rm -rf ./dist | |
NODE_ENV=production | |
webpack --progress -p | |
COMPRESS=1 webpack | |
npm run deploy |
This file contains 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 React from "react"; | |
export default class LoginForm extends React.Component { | |
render(){ | |
return( | |
<form> | |
<p>Login</p> | |
<div className="label-input"> | |
<label>Email Address</label> |
This file contains 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 React from "react"; | |
import LabelInput from "./LabelInput"; | |
export default class LoginForm extends React.Component { | |
render(){ | |
const {email, password, onSubmit, onChange} = this.props; | |
return( | |
<form> | |
<p>Login</p> |
OlderNewer