-
-
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.
Merge pull request #132 from gaearon/next
New API
- Loading branch information
Showing
92 changed files
with
1,276 additions
and
2,144 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,14 +1,30 @@ | ||
# Redux DevTools Counter example | ||
|
||
## Running example | ||
## Running Example | ||
|
||
First, clone the project: | ||
|
||
``` | ||
git clone https://github.com/gaearon/redux-devtools.git | ||
``` | ||
|
||
Then install the dependencies in the root folder: | ||
|
||
``` | ||
cd redux-devtools | ||
npm install | ||
``` | ||
|
||
Install the dependencies in the example folder: | ||
|
||
``` | ||
cd examples/counter | ||
npm install | ||
``` | ||
|
||
Finally, run the project: | ||
|
||
``` | ||
npm start | ||
open http://localhost:3000 | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
import { createDevTools } from 'redux-devtools'; | ||
import LogMonitor from 'redux-devtools-log-monitor'; | ||
import DockMonitor from 'redux-devtools-dock-monitor'; | ||
|
||
export default createDevTools( | ||
<DockMonitor toggleVisibilityKey='ctrl-h' | ||
changePositionKey='ctrl-q'> | ||
<LogMonitor /> | ||
</DockMonitor> | ||
); |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React, { Component } from 'react'; | ||
import { Provider } from 'react-redux'; | ||
import CounterApp from './CounterApp'; | ||
import DevTools from './DevTools'; | ||
|
||
export default class Root extends Component { | ||
render() { | ||
const { store } = this.props; | ||
return ( | ||
<Provider store={store}> | ||
<div> | ||
<CounterApp /> | ||
<DevTools /> | ||
</div> | ||
</Provider> | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./Root.prod'); | ||
} else { | ||
module.exports = require('./Root.dev'); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React, { Component } from 'react'; | ||
import { Provider } from 'react-redux'; | ||
import CounterApp from './CounterApp'; | ||
|
||
export default class Root extends Component { | ||
render() { | ||
const { store } = this.props; | ||
return ( | ||
<Provider store={store}> | ||
<CounterApp /> | ||
</Provider> | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
import configureStore from './store/configureStore'; | ||
import Root from './containers/Root'; | ||
|
||
const store = configureStore(); | ||
|
||
render( | ||
<Root store={store} />, | ||
document.getElementById('root') | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { combineReducers } from 'redux'; | ||
import counter from './counter'; | ||
|
||
const rootReducer = combineReducers({ | ||
counter | ||
}); | ||
|
||
export default rootReducer; |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { createStore, applyMiddleware, compose } from 'redux'; | ||
import { persistState } from 'redux-devtools'; | ||
import thunk from 'redux-thunk'; | ||
import rootReducer from '../reducers'; | ||
import DevTools from '../containers/DevTools'; | ||
|
||
const finalCreateStore = compose( | ||
applyMiddleware(thunk), | ||
DevTools.instrument(), | ||
persistState( | ||
window.location.href.match( | ||
/[?&]debug_session=([^&]+)\b/ | ||
) | ||
) | ||
)(createStore); | ||
|
||
export default function configureStore(initialState) { | ||
const store = finalCreateStore(rootReducer, initialState); | ||
|
||
if (module.hot) { | ||
module.hot.accept('../reducers', () => | ||
store.replaceReducer(require('../reducers')) | ||
); | ||
} | ||
|
||
return store; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./configureStore.prod'); | ||
} else { | ||
module.exports = require('./configureStore.dev'); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { createStore, applyMiddleware, compose } from 'redux'; | ||
import thunk from 'redux-thunk'; | ||
import rootReducer from '../reducers'; | ||
|
||
const finalCreateStore = compose( | ||
applyMiddleware(thunk) | ||
)(createStore); | ||
|
||
export default function configureStore(initialState) { | ||
return finalCreateStore(rootReducer, initialState); | ||
} |
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,7 +1,30 @@ | ||
# Redux DevTools TodoMVC example | ||
# Redux DevTools Counter example | ||
|
||
## Getting Started | ||
## Running Example | ||
|
||
1. Install dependencies in the root folder: `cd ../..` and `npm i` | ||
2. Install dependencies in the example folder: `cd examples/todomvc` and `npm i` | ||
3. Start the development server: `npm start` | ||
First, clone the project: | ||
|
||
``` | ||
git clone https://github.com/gaearon/redux-devtools.git | ||
``` | ||
|
||
Then install the dependencies in the root folder: | ||
|
||
``` | ||
cd redux-devtools | ||
npm install | ||
``` | ||
|
||
Install the dependencies in the example folder: | ||
|
||
``` | ||
cd examples/todomvc | ||
npm install | ||
``` | ||
|
||
Finally, run the project: | ||
|
||
``` | ||
npm start | ||
open http://localhost:3000 | ||
``` |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
import { createDevTools } from 'redux-devtools'; | ||
import LogMonitor from 'redux-devtools-log-monitor'; | ||
import DockMonitor from 'redux-devtools-dock-monitor'; | ||
|
||
export default createDevTools( | ||
<DockMonitor toggleVisibilityKey='ctrl-h' | ||
changePositionKey='ctrl-q'> | ||
<LogMonitor /> | ||
</DockMonitor> | ||
); |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React, { Component } from 'react'; | ||
import { Provider } from 'react-redux'; | ||
import TodoApp from './TodoApp'; | ||
import DevTools from './DevTools'; | ||
|
||
export default class Root extends Component { | ||
render() { | ||
const { store } = this.props; | ||
return ( | ||
<Provider store={store}> | ||
<div> | ||
<TodoApp /> | ||
<DevTools /> | ||
</div> | ||
</Provider> | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./Root.prod'); | ||
} else { | ||
module.exports = require('./Root.dev'); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React, { Component } from 'react'; | ||
import { Provider } from 'react-redux'; | ||
import TodoApp from './TodoApp'; | ||
|
||
export default class Root extends Component { | ||
render() { | ||
const { store } = this.props; | ||
return ( | ||
<Provider store={store}> | ||
<TodoApp /> | ||
</Provider> | ||
); | ||
} | ||
} |
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,8 +1,12 @@ | ||
import React from 'react'; | ||
import App from './containers/App'; | ||
import 'todomvc-app-css/index.css'; | ||
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
import configureStore from './store/configureStore'; | ||
import Root from './containers/Root'; | ||
|
||
const store = configureStore(); | ||
|
||
React.render( | ||
<App />, | ||
render( | ||
<Root store={store} />, | ||
document.getElementById('root') | ||
); |
Oops, something went wrong.