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 { | |
updateRouterState | |
} from '../actions/RouterActions'; | |
function mapStateToProps(store) { | |
return {} | |
} | |
function mapDispatchToProps(dispatch) { | |
return { |
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
// The Redux Store | |
{ | |
posts : [{ | |
...stuff, | |
userId: 1 | |
tagIds: [1,2,3] | |
}], | |
users: [{ | |
...stuff, |
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 { createAction } from 'redux-actions'; | |
import * as WebUtils from '../webUtils/index'; | |
import { | |
SELECT_MEAL, | |
UPDATE_MEAL_PROP, | |
BEGIN_CREATING_MEAL, | |
SUCCESS_CREATING_MEAL, | |
ERROR_CREATING_MEAL, | |
BEGIN_LOADING_MEALS, |
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 Flux from './Flux.js' | |
import Flux from './components/App.jsx' | |
// Within document ready | |
const payload = document.getElementById('payload'); | |
const flux = new AppFlux(); | |
flux.serialize(payload); |
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/polyfill'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Router, Route } from 'react-router'; | |
import { reduxRouteComponent, routerStateReducer } from 'redux-react-router'; | |
import { createStore, combineReducers, applyMiddleware, compose } from 'redux'; | |
import thunk from 'redux-thunk'; | |
import BrowserHistory from 'react-router/lib/BrowserHistory'; | |
import routes from '../shared/components/routes'; | |
import * as reducers from '../shared/reducers/index'; |
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
// WebUtils | |
WebUtils = { | |
fetchMe: function(opts) { | |
return new Promise(function(resolve, reject) { | |
request.get(`${SOUNDCLOUD_URL}/me`) | |
.query(opts) | |
.end((err, res) => { me: res.body }); | |
} | |
}); | |
} |
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 React = { | |
Children: { | |
map: ReactChildren.map, | |
forEach: ReactChildren.forEach, | |
count: ReactChildren.count, | |
only: onlyChild | |
}, | |
Component: ReactComponent, | |
DOM: ReactDOM, |
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
"scripts": { | |
"start": "npm run webpack & npm run serve", | |
"webpack": "webpack -w", | |
"serve": "cd example && python -m SimpleHTTPServer" | |
} |
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> | |
<head> | |
<script src="http://fb.me/react-with-addons-0.12.0.js"></script> | |
<meta charset="utf-8"> | |
<title>React JS quick start guide</title> | |
<style id="jsbin-css"> | |
body { | |
margin: 0; | |
background: #E8E8E8; |
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
// 1. Components load for the first time. | |
// 2. An action causes the node to be removed. | |
// 1. Element will enter the DOM | |
componentWillEnter: function(callback) { | |
callback(); | |
console.log('will enter'); | |
}, | |
// // 1. Element is now in the DOM |