Skip to content

Commit

Permalink
Implement tracing in the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zalmoxisus committed Dec 15, 2018
1 parent af37aa3 commit 64717bb
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/counter/store/configureStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as actionCreators from '../actions/counter';

export let isMonitorAction;
export default function configureStore(preloadedState) {
const composeEnhancers = composeWithDevTools({ actionCreators });
const composeEnhancers = composeWithDevTools({ actionCreators, trace: true, traceLimit: 25 });

This comment has been minimized.

Copy link
@teddcp2

teddcp2 Jan 5, 2021

For people, who are wondering about actionCreators --> all the actions

import * as actionCreators from '../actions/counter'; 

link

This comment has been minimized.

Copy link
@windmaomao

windmaomao Nov 16, 2021

So on top of all the reducers, it needs all the actions to do the tracing, right?

This comment has been minimized.

Copy link
@si-muhammad-qasim

si-muhammad-qasim Dec 5, 2022

For people, who are wondering about actionCreators --> all the actions

import * as actionCreators from '../actions/counter'; 

link
great!

const store = createStore(reducer, preloadedState, composeEnhancers(
applyMiddleware(invariant(), thunk)
));
Expand Down
2 changes: 1 addition & 1 deletion examples/counter/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var path = require('path');
var webpack = require('webpack');

module.exports = {
devtool: 'cheap-module-eval-source-map',
devtool: 'source-map',
entry: [
'webpack-hot-middleware/client',
'./index'
Expand Down
3 changes: 2 additions & 1 deletion examples/saga-counter/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import rootSaga from './sagas'


const sagaMiddleware = createSagaMiddleware(/* {sagaMonitor} */)
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ &&
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ trace: true, traceLimit: 25 }) || compose;

This comment has been minimized.

Copy link
@sfonua10

sfonua10 Apr 22, 2021

πŸ‘

This comment has been minimized.

Copy link
@mentor-27

mentor-27 May 23, 2024

πŸ‘πŸ‘πŸ‘

const store = createStore(
reducer,
composeEnhancers(applyMiddleware(sagaMiddleware))
Expand Down
2 changes: 1 addition & 1 deletion examples/saga-counter/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var path = require('path')
var webpack = require('webpack')

module.exports = {
devtool: 'cheap-module-eval-source-map',
devtool: 'source-map',
entry: [
'webpack-hot-middleware/client',
path.join(__dirname, 'src', 'main')
Expand Down
2 changes: 1 addition & 1 deletion examples/todomvc/store/configureStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as actionCreators from '../actions';

export default function configureStore(preloadedState) {
const enhancer = window.__REDUX_DEVTOOLS_EXTENSION__ &&
window.__REDUX_DEVTOOLS_EXTENSION__({ actionCreators, serialize: true });
window.__REDUX_DEVTOOLS_EXTENSION__({ actionCreators, serialize: true, trace: true });
if (!enhancer) {
console.warn('Install Redux DevTools Extension to inspect the app state: ' +
'https://github.com/zalmoxisus/redux-devtools-extension#installation')
Expand Down
2 changes: 1 addition & 1 deletion examples/todomvc/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var path = require('path');
var webpack = require('webpack');

module.exports = {
devtool: 'cheap-module-eval-source-map',
devtool: 'source-map',
entry: [
'webpack-hot-middleware/client',
'./index'
Expand Down

2 comments on commit 64717bb

@ppaul
Copy link

@ppaul ppaul commented on 64717bb Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do you do this for redux saga, where we have:
composeWithDevTools(applyMiddleware(sagaMiddleware))
as
composeWithDevTools({ ...applyMiddleware(sagaMiddleware), trace: true }) will not work
?

@nigelsim
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See here

composeWithDevTools({ trace: true })(applyMiddleware(sagaMiddleware))

Please sign in to comment.