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
$(document).ready(function(){ | |
$.getJSON( "google_places.json", function( data ) { | |
}); | |
}); |
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
<!doctype html> | |
<html class="no-js" lang=""> | |
<head> | |
<meta charset="utf-8"> | |
<title>ReactJS Chapter 1</title> | |
<link rel="stylesheet" href="css/bootstrap.min.css"> | |
<script type="text/javascript" src="js/react.min.js"></script> | |
<script type="text/javascript" src="js/react-dom.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script> |
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
<!DOCTYPE html> | |
<html class="no-js" lang=""> | |
<head> | |
<meta charset="utf-8"> | |
<title>ReactJS Chapter 1</title> | |
<link rel="stylesheet" href="css/bootstrap.min.css"> | |
<link rel="stylesheet" href="css/custom.css"> | |
<script type="text/javascript" src="js/react.min.js"></script> | |
<script type="text/javascript" src="js/react-dom.min.js"></script> |
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
<!DOCTYPE html> | |
<html class="no-js" lang=""> | |
<head> | |
<meta charset="utf-8"> | |
<title>ReactJS Chapter 1</title> | |
<link rel="stylesheet" href="css/bootstrap.min.css"> | |
<link rel="stylesheet" href="css/custom.css"> | |
<script type="text/javascript" src="js/react.min.js"></script> | |
<script type="text/javascript" src="js/react-dom.min.js"></script> |
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 NameForm extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = {value: ''}; | |
this.handleChange = this.handleChange.bind(this); | |
this.handleSubmit = this.handleSubmit.bind(this); | |
} | |
handleChange(event) { |
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 Detail extends React.Component{ | |
constructor(props){ | |
super(props); | |
this.state = { | |
commits: [], | |
mode: "commits", | |
forks: [], | |
pulls: [] |
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'; | |
const STATUS = { | |
HOVERED: 'hovered', | |
NORMAL: 'normal', | |
}; | |
export default class Link extends React.Component { | |
constructor(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
let HigherOrderComp = (Component) => class extends React.Component{ | |
construstor(props){ | |
super(props); | |
this.state = { | |
count: 0 | |
}; | |
} | |
componentDidMount(){ | |
setInterval(()=>{ |
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
//constants/app-constants.js | |
let constants = { | |
INCREMENT: "INCREMENT" | |
}; | |
export default constants; | |
//dispatcher/dispatcher.js | |
import {Dispatcher} from 'flux'; |
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
//actions/app-actions.js | |
import constants from '../constants/app-constants'; | |
import dispatcher from '../dispatcher/dispatcher'; | |
export let incrementActions = { | |
incrementCount: ()=>{ | |
console.log('- inside incrementActions in app actions'); | |
dispatcher.dispatch({ | |
actionType: constants.INCREMENT | |
}); |
OlderNewer