Working on pipeline stuff
This commit is contained in:
+3
-9
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
import { createStore, applyMiddleware, compose } from 'redux';
|
||||
import { createStore, applyMiddleware } from 'redux';
|
||||
import thunk from 'redux-thunk';
|
||||
|
||||
import DevTools from './dev_tools.jsx';
|
||||
@@ -17,10 +17,7 @@ account = account ? JSON.parse(account) : {};
|
||||
var store = createStore(
|
||||
reducer,
|
||||
{ account: account }, //initial state
|
||||
compose(
|
||||
applyMiddleware(thunk),
|
||||
DevTools.instrument()
|
||||
)
|
||||
applyMiddleware(thunk)
|
||||
);
|
||||
|
||||
//persistence
|
||||
@@ -31,10 +28,7 @@ store.subscribe(() => {
|
||||
//start the process
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
<div>
|
||||
<App />
|
||||
<DevTools />
|
||||
</div>
|
||||
<App />
|
||||
</Provider>,
|
||||
document.querySelector("#root")
|
||||
);
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
import { createStore, applyMiddleware, compose } from 'redux';
|
||||
import thunk from 'redux-thunk';
|
||||
|
||||
import DevTools from './dev_tools.jsx';
|
||||
import App from './components/app.jsx';
|
||||
|
||||
import reducer from './reducers/reducer.js';
|
||||
|
||||
//persistence
|
||||
let ITEM_NAME = 'account.kingdombattles';
|
||||
let account = localStorage.getItem(ITEM_NAME);
|
||||
account = account ? JSON.parse(account) : {};
|
||||
|
||||
var store = createStore(
|
||||
reducer,
|
||||
{ account: account }, //initial state
|
||||
compose(
|
||||
applyMiddleware(thunk),
|
||||
DevTools.instrument()
|
||||
)
|
||||
);
|
||||
|
||||
//persistence
|
||||
store.subscribe(() => {
|
||||
localStorage.setItem(ITEM_NAME, JSON.stringify(store.getState().account));
|
||||
});
|
||||
|
||||
//start the process
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
<div>
|
||||
<App />
|
||||
<DevTools />
|
||||
</div>
|
||||
</Provider>,
|
||||
document.querySelector("#root")
|
||||
);
|
||||
Reference in New Issue
Block a user