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
function compose(firstFunction, secondFunction) { | |
return function(valueFromPassedInFunctions) { | |
return firstFunction(secondFunction(valueFromPassedInFunctions)) | |
} | |
} | |
function secondFunction(value) { | |
return value.toLowerCase() | |
} |
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, { Component, PropTypes } from 'react' | |
import { bindActionCreators } from 'redux' | |
import { connect } from 'react-redux' | |
import Header from '../components/Header' | |
import MainSection from '../components/MainSection' | |
import * as TodoActions from '../actions/todos' | |
class App extends Component { | |
render() { | |
const { todos, actions } = this.props |
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 {Link} from 'react-router'; | |
import React, {Component} from 'react'; | |
import {Tabs, Tab, Styles} from 'material-ui'; | |
const ThemeManager = Styles.ThemeManager; | |
const DefaultRawTheme = Styles.LightRawTheme; | |
const Colors = Styles.Colors; | |
const ThemeDecorator = Styles.ThemeDecorator; | |
let injectTapEventPlugin = require('react-tap-event-plugin'); |
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 ReactDOM from 'react-dom'; | |
export default class Form extends React.Component{ | |
constructor(){ | |
super(); | |
this.state = { | |
names: [] | |
} |
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'; | |
export default class List extends React.Component { | |
render() { | |
let names = this.props.names.map((person, index) => { | |
return ( | |
<div id="person" key={person + index}> | |
<div>Hello {person.firstName}</div> | |
<div>{person.lastName}</div> | |
</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
import Dispatcher from '../dispatchers/dispatcher'; | |
import AppConstants from '../constants/appConstants'; | |
import { EventEmitter } from 'events'; | |
import { findIndex } from 'lodash'; | |
var names = [{firstName: "jonathan", lastName: "sevold"}]; | |
function addNameToStore(name) { | |
names.push(name); |
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 'babel-core/polyfill' | |
import React from 'react' | |
import { render } from 'react-dom' | |
import { Provider } from 'react-redux' | |
import App from './containers/App' | |
import configureStore from './store/configureStore' | |
import 'todomvc-app-css/index.css' | |
const store = configureStore() |
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 fetch = require('node-fetch'); | |
var url = "running before everything else"; | |
fetch('https://api.github.com/users/jmsevold') | |
.then(function(res) { | |
return res.json(); | |
}).then(function(result) { |
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
renderFirstQuestion() { | |
let answers = Object.keys(this.state.questions[0].answers) | |
let images = this.state.questions[0].images | |
let renderImages = Object.keys(images).map((image, index) => { | |
return ( | |
<div> | |
<FirstQuestion | |
key={images[image] + index} | |
imgSrc={images[image]} /> | |
</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
class App extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
clicked: false | |
} | |
} | |
doSomething() { | |
this.setState({clicked: true}) | |
console.log("state of clicked is", this.state.clicked) |