-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
60 lines (50 loc) · 1.59 KB
/
index.js
File metadata and controls
60 lines (50 loc) · 1.59 KB
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
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, combineReducers, applyMiddleware } from 'redux'
import { Provider } from 'react-redux';
import { ConnectedRouter, routerReducer, routerMiddleware } from 'react-router-redux'
import createHistory from 'history/createBrowserHistory'
import * as reducers from './reducers'
import * as middlewares from './middlewares'
import registerServiceWorker from './registerServiceWorker';
import App from './App';
import './index.css';
const history = createHistory();
const store = createStore(
combineReducers({
...reducers,
router: routerReducer
}),
applyMiddleware(
...Object.values(middlewares),
routerMiddleware(history)
)
);
// TESTING STUFF
const unsubscribe = store.subscribe(() => console.log(store.getState())); // eslint-disable-line no-unused-vars
/* store.dispatch({
type: 'ADD_CHANNEL',
data: {
id: 'rocketblasttv'
}
})*/
// unsubscribe();
window.store = store;
import * as channelActions from './actions/channels-actions'; // eslint-disable-line import/first
const actions = window.actions = {
...channelActions,
};
store.dispatch(actions.addChannel('monstercat'));
store.dispatch(actions.addChannel('rocketblast'));
store.dispatch(actions.addChannel('wizzlertv'));
store.dispatch(actions.addChannel('kreamylol'));
// NOT TESTING ANYMORE
ReactDOM.render(
<Provider store={ store }>
<ConnectedRouter history={ history }>
<App />
</ConnectedRouter>
</Provider>,
document.getElementById('root')
);
registerServiceWorker();