-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
73 lines (57 loc) · 1.59 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import React from 'react';
import ReactDOM from 'react-dom';
import './assets/index.css';
import App from './App';
import reducer from './reducers/index.js' /// DO I NEED THIS LAST PART???
import 'semantic-ui-css/semantic.min.css';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
// console.log('before createStore');
const store = createStore(reducer)
// console.log("the store",store.getState());
// console.log(store);
// console.log('after createStore', store.getState());
//
// const action = {
// type: "CLICK_EVENT", // ALL CAPS WITH _
// }
// store.dispatch(action);
// console.log('after CLICK_EVENT', store.getState());
ReactDOM.render(
<Provider store={store}><App /></Provider>, document.getElementById('root'));
// USE ROUTER???
// <Router><App /></Router>???
///////OLD REDUX SETUP/////////
//
// 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)