-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
daa1c1a
commit 01b0c4d
Showing
12 changed files
with
55 additions
and
173 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,58 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './index.css'; | ||
import './assets/index.css'; | ||
import App from './App'; | ||
import registerServiceWorker from './registerServiceWorker'; | ||
|
||
import 'semantic-ui-css/semantic.min.css'; | ||
|
||
import { combineReducers, createStore } from 'redux'; | ||
|
||
function usersReducer(state = [], action){ | ||
return state; | ||
} | ||
|
||
function teamsReducer(state = '', action){ | ||
switch (action.type) { | ||
case 'UPDATE_TEAM': | ||
return action.payload; | ||
} | ||
return state; | ||
} | ||
|
||
const allReducers = combineReducers({ | ||
users: usersReducer, | ||
teams: teamsReducer | ||
}) | ||
const store = createStore( | ||
allReducers, | ||
{ | ||
users: [{name: "Ian"}], | ||
teams: "The Best Team" | ||
}, | ||
window.devToolsExtension && window.devToolsExtension() | ||
); | ||
|
||
console.log(store.getState()); | ||
|
||
const updateTeamAction = { | ||
type: 'UPDATE_TEAM', | ||
payload: { | ||
teams: "The Worst Team" | ||
} | ||
}; | ||
|
||
store.dispatch(updateTeamAction) | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); | ||
registerServiceWorker(); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
///////OLD REDUX SETUP///////// | ||
// | ||
// function usersReducer(state = [], action){ | ||
// return state; | ||
// } | ||
// function teamsReducer(state = '', action){ | ||
// switch (action.type) { | ||
// case 'UPDATE_TEAM': | ||
// return action.payload; | ||
// } | ||
// return state; | ||
// } | ||
// const allReducers = combineReducers({ | ||
// users: usersReducer, | ||
// teams: teamsReducer | ||
// }) | ||
// const store = createStore( | ||
// allReducers, | ||
// { | ||
// users: [{name: "Ian"}], | ||
// teams: "The Best Team" | ||
// }, | ||
// window.devToolsExtension && window.devToolsExtension() | ||
// ); | ||
// console.log(store.getState()); | ||
// const updateTeamAction = { | ||
// type: 'UPDATE_TEAM', | ||
// payload: { | ||
// teams: "The Worst Team" | ||
// } | ||
// }; | ||
// store.dispatch(updateTeamAction) |
This file was deleted.
Oops, something went wrong.