Commit 4cb19feb19f09ec24e9ab9ee78c7df9337ce2f68
more plates to boil
Michael Williams committed on 11/29/2015, 12:41:30 AMParent: bddcd75da91760d6e309a822e422b3027b1b9dfd
Files changed
app/client.js | changed |
app/containers/landing.js | added |
app/reducers/todos.js | changed |
app/routes.js | changed |
app/store.js | changed |
app/state.js | deleted |
package.json | changed |
app/client.js | ||
---|---|---|
@@ -4,16 +4,13 @@ | ||
4 | 4 | import { reduxReactRouter, routerStateReducer, ReduxRouter } from 'redux-router'; |
5 | 5 | const { Provider } = require('react-redux') |
6 | 6 | const thunk = require('redux-thunk') |
7 | 7 | |
8 | -const initialState = require('app/state') | |
9 | 8 | const configureStore = require('app/store') |
10 | -const { getAllTodos } = require('app/actions') | |
9 | +const { findTodos } = require('app/actions') | |
11 | 10 | const Root = require('app/containers/root') |
12 | 11 | |
13 | -const store = configureStore( | |
14 | - initialState | |
15 | -) | |
12 | +const store = configureStore() | |
16 | 13 | |
17 | 14 | //store.dispatch(getAllTodos()) |
18 | 15 | |
19 | 16 | render( |
app/containers/landing.js | ||
---|---|---|
@@ -1,0 +1,14 @@ | ||
1 | +const React = require('react') | |
2 | +const { connect } = require('react-redux') | |
3 | + | |
4 | +class Landing extends React.Component { | |
5 | + render () { | |
6 | + return <div> | |
7 | + landing! | |
8 | + </div> | |
9 | + } | |
10 | +} | |
11 | + | |
12 | +module.exports = connect( | |
13 | + (state) => { return {} } | |
14 | +)(Landing) |
app/reducers/todos.js | ||
---|---|---|
@@ -1,17 +1,12 @@ | ||
1 | -const initialState = require('app/state') | |
2 | - | |
3 | 1 | module.exports = todos |
4 | 2 | |
5 | -function todos (state = initialState, action) { | |
3 | +function todos (state = {}, action) { | |
6 | 4 | switch (action.type) { |
7 | - case 'ADD_TODO': | |
5 | + case 'CREATE_TODO': | |
8 | 6 | return { |
9 | 7 | ...state, |
10 | - todos: { | |
11 | - ...state.todos, | |
12 | - [action.payload.id]: action.payload | |
13 | - } | |
8 | + [action.payload.id]: action.payload | |
14 | 9 | } |
15 | 10 | default: |
16 | 11 | return state |
17 | 12 | } |
app/routes.js | ||
---|---|---|
@@ -1,13 +1,15 @@ | ||
1 | 1 | const React = require('react') |
2 | -const { Route } = require('react-router') | |
2 | +const { Route, IndexRoute } = require('react-router') | |
3 | 3 | |
4 | 4 | const App = require('app/containers/app') |
5 | +const Landing = require('app/containers/landing') | |
5 | 6 | const Todos = require('app/containers/todos') |
6 | 7 | const NoMatch = require('app/containers/no-match') |
7 | 8 | |
8 | 9 | const routes = ( |
9 | 10 | <Route path='/' component={App}> |
11 | + <IndexRoute component={Landing} /> | |
10 | 12 | <Route path='todos' component={Todos} /> |
11 | 13 | <Route path="*" component={NoMatch} /> |
12 | 14 | </Route> |
13 | 15 | ) |
app/store.js | ||
---|---|---|
@@ -1,8 +1,7 @@ | ||
1 | 1 | const { createStore, compose, applyMiddleware } = require('redux') |
2 | 2 | const thunk = require('redux-thunk') |
3 | -const logger = require('redux-logger') | |
4 | -const { reduxReactRouter, routerStateReducer, ReduxRouter } = require('redux-router') | |
3 | +const { reduxReactRouter } = require('redux-router') | |
5 | 4 | const { createHistory } = require('history') |
6 | 5 | |
7 | 6 | const reducer = require('app/reducers') |
8 | 7 | const routes = require('routes') |
@@ -12,8 +11,9 @@ | ||
12 | 11 | |
13 | 12 | middleware.push(thunk) |
14 | 13 | |
15 | 14 | if (process.env.NODE_ENV === 'development') { |
15 | + var logger = require('redux-logger') | |
16 | 16 | var { persistState } = require('redux-devtools') |
17 | 17 | |
18 | 18 | var DevTools = require('app/components/dev-tools') |
19 | 19 | } |
package.json | ||
---|---|---|
@@ -12,9 +12,9 @@ | ||
12 | 12 | "feature": "node feature", |
13 | 13 | "dev:client": "budo client --dir assets --serve bundle.js --live --pushstate -- -dv", |
14 | 14 | "dev:assets": "cpx \"app/assets/**/*\" assets -w", |
15 | 15 | "dev:server": "nodemon server", |
16 | - "prod:client": "browserify client -o assets/bundle.js -g uglifyify", | |
16 | + "prod:client": "browserify client -o assets/bundle.js -g envify -g uglifyify", | |
17 | 17 | "prod:assets": "cpx \"app/assets/**/*\" assets", |
18 | 18 | "prod:server": "node server", |
19 | 19 | "dev": "NODE_ENV=development npm-run-all -p dev:*", |
20 | 20 | "prod": "NODE_ENV=production npm-run-all -s prod:*" |
@@ -80,9 +80,9 @@ | ||
80 | 80 | "react-dom": "^0.14.3", |
81 | 81 | "react-redux": "^4.0.0", |
82 | 82 | "react-router": "^1.0.0", |
83 | 83 | "redux": "^3.0.4", |
84 | - "redux-router": "^1.0.0-beta4", | |
84 | + "redux-router": "^1.0.0-beta5", | |
85 | 85 | "redux-thunk": "^1.0.0", |
86 | 86 | "sheetify": "^3.1.0", |
87 | 87 | "uglifyify": "^3.0.1" |
88 | 88 | } |
Built with git-ssb-web