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
/** | |
* Somewhere in an app module, pull in the app specific translator | |
*/ | |
import t from 'util/translate' | |
t("Edu_bs") | |
// => "Bachelor's" |
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
/** | |
* Ref $elector Mixin | |
*/ | |
export default { | |
$(ref) { | |
return this.refs[ref].getDOMNode() | |
} | |
} |
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
let validActions = { | |
[GameConstants.GAME_CREATE]: null, | |
[GameConstants.GAME_JOIN]: null, | |
[GameConstants.GAME_EXIT]: null, | |
[GameConstants.USER_JOINED]: null, | |
[GameConstants.USER_LEFT]: null | |
} | |
GameDispatcher.register( ({actionType, data}) => { | |
if (actionType in validActions) { |
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
// some pieces of this file have been omitted | |
let React = require('react') | |
let notesStore = require('../../stores/notesStore') | |
let monitorMixin = require('../../mixins/monitorMixin') | |
let Notes = React.createClass({ | |
mixins: [monitorMixin(notesStore)] | |
// this gets called whenever `notesStore` emits a change event |
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
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => { | |
return [1, 2, 3]; |
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
{ | |
"name": "Ashe's Pokedex", | |
"sort": "byName", | |
"order": "descending", | |
"pokemon": [ | |
{ | |
"id": 4, | |
"name": "Charmander", | |
"types": "fire", | |
"species": "lizard", |
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(callback) { | |
if (someCond) return void callback(); | |
// do things | |
return "some value"; | |
} |
NewerOlder