Skip to content

Commit

Permalink
Enable devtools trace by default (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
albertogasparin authored Apr 26, 2023
1 parent 230ef82 commit 6828106
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/enhancers/__tests__/devtools.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ describe('withDevtools', () => {
expect(window.__REDUX_DEVTOOLS_EXTENSION__.connect).toHaveBeenCalledWith({
name: 'Store store-key@scope',
serialize: true,
trace: true,
});
expect(devToolsMock.init).toHaveBeenCalledWith({ count: 0 });
expect(devToolsMock.subscribe).toHaveBeenCalled();
Expand All @@ -64,6 +65,7 @@ describe('withDevtools', () => {
defaults.devtools = (storeState) => ({
name: `CustomStore ${storeState.key}`,
stateSanitizer: jest.fn(),
trace: false,
});
storeStateMock.getState.mockReturnValue({ count: 0 });
const store = withDevtools(createStoreMock)();
Expand All @@ -73,6 +75,7 @@ describe('withDevtools', () => {
name: 'CustomStore store-key@scope',
serialize: true,
stateSanitizer: expect.any(Function),
trace: false,
});
});

Expand Down
5 changes: 4 additions & 1 deletion src/enhancers/devtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import defaults from '../defaults';

const connectDevTools = (storeState, config) => {
const devTools = window.__REDUX_DEVTOOLS_EXTENSION__.connect(
Object.assign({ name: `Store ${storeState.key}`, serialize: true }, config)
Object.assign(
{ name: `Store ${storeState.key}`, serialize: true, trace: true },
config
)
);
devTools.init(storeState.getState());
devTools.subscribe((message) => {
Expand Down

0 comments on commit 6828106

Please sign in to comment.