-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Showing
2 changed files
with
23 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,34 @@ | ||
import React, { Component } from 'react'; | ||
import CounterApp from './CounterApp'; | ||
import { createStore, applyMiddleware, combineReducers } from 'redux'; | ||
import { createStore, applyMiddleware, combineReducers, compose } from 'redux'; | ||
import { devTools, persistState } from 'redux-devtools'; | ||
import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'; | ||
import thunk from 'redux-thunk'; | ||
import { Provider } from 'react-redux'; | ||
import * as reducers from '../reducers'; | ||
|
||
const createStoreWithMiddleware = applyMiddleware(thunk)(createStore); | ||
const finalCreateStore = compose( | ||
applyMiddleware(thunk), | ||
devTools(), | ||
persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/)), | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
createStore | ||
); | ||
|
||
const reducer = combineReducers(reducers); | ||
const store = createStoreWithMiddleware(reducer); | ||
const store = finalCreateStore(reducer); | ||
|
||
export default class App extends Component { | ||
render() { | ||
return ( | ||
<Provider store={store}> | ||
{() => <CounterApp />} | ||
</Provider> | ||
<div> | ||
<Provider store={store}> | ||
{() => <CounterApp />} | ||
</Provider> | ||
<DebugPanel top right bottom> | ||
<DevTools store={store} | ||
monitor={LogMonitor} /> | ||
</DebugPanel> | ||
</div> | ||
); | ||
} | ||
} |
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 passes the entire array of matches. Should this code select the parenthesized substring match?
Otherwise, if the debug_sessions changes between first parameter or subsequent parameters (? vs &), the local storage key would change.
This would need changed in the readme documentation as well.