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 SomeComponent = React.createClass({ | |
propTypes: { | |
doSomething: React.PropTypes.func | |
}, | |
someOtherFunction: function() { | |
// Do some other stuff | |
this.props.doSomething(); | |
}, |
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 Foo = React.createClass({ | |
propTypes: { | |
bar: React.propTypes.string | |
}, | |
render: function() { | |
return ( | |
<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
const foo = {/* stuff here... */}; | |
const pSomething = new Promise(() => foo.bar.baz.yeah.nah.something); | |
pSomething.then(something => { | |
// Same as if | |
}).catch(() => { | |
// Same as else | |
}); |
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 React from 'react'; | |
import moment from 'moment'; | |
const Foo = React.createClass({ | |
render: function() { | |
let times = [], timeIterator = moment(0); | |
for(let i = 0; i < 48; i++) { | |
times.push(timeIterator); | |
timeIterator.add(30, "minutes"); |
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
aura_env.updateInterval = 0.05 | |
aura_env.lastUpdate = GetTime() | |
-- SpellID of the spell icon we're showing | |
aura_env.recommended = 212812 | |
-- How many milliseconds until we should use the next ability | |
aura_env.recommendedWait = 0 | |
-- Abilities |
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 path = require('path'); | |
const webpackSettings = { | |
entry: `${__dirname}/src/index.js`, | |
output: { | |
path: `${__dirname}/static/`, | |
publicPath: '/', | |
filename: 'bundle.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
-- init | |
aura_env.updateInterval = 0.05 | |
aura_env.lastUpdate = GetTime() | |
-- SpellID of the spell icon we're showing | |
aura_env.recommended = 212812 | |
-- How many milliseconds until we should use the next ability | |
aura_env.recommendedWait = 0 |
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 { createSelector } from 'reselect'; | |
const shopItemsSelector = state => state.shop.items; | |
const taxPercentSelector = state => state.shop.taxPercent; | |
const subtotalSelector = createSelector( | |
shopItemsSelector, | |
items => items.reduce((acc, item) => acc + item.value, 0) | |
); |
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 Article = React.createClass({ | |
propTypes: { | |
highlighted: React.PropTypes.boolean | |
}, | |
render: function() { | |
return ( | |
<article className={this.props.highlighted ? "highlighted" : "not-highlighted"}/> | |
); |
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
// Fairly typical page layout | |
const Foo = props => | |
<div className="page"> | |
<div className="header"> | |
<Logo/> | |
<Menu/> | |
<AccountOptions/> | |
</div> | |
<div className="body"> |
OlderNewer