Skip to content

Commit 6542765

Browse files
committed
Enable logActions by default and not deepClone state for actions
1 parent 3881bbd commit 6542765

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

docs/guide/plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const logger = createLogger({
128128
// Same as mutationTransformer but for actions
129129
return action.type
130130
},
131-
logActions: false, // Log Actions
131+
logActions: true, // Log Actions
132132
logMutations: true, // Log mutations
133133
logger: console, // implementation of the `console` API, default `console`
134134
})

src/plugins/logger.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function createLogger ({
99
mutationTransformer = mut => mut,
1010
actionFilter = (action, state) => true,
1111
actionTransformer = act => act,
12-
logActions = false,
12+
logActions = true,
1313
logMutations = true,
1414
logger = console
1515
} = {}) {
@@ -42,9 +42,7 @@ export default function createLogger ({
4242

4343
if (logActions) {
4444
store.subscribeAction((action, state) => {
45-
const currentState = deepCopy(state)
46-
47-
if (actionFilter(action, currentState)) {
45+
if (actionFilter(action, state)) {
4846
const formattedTime = getFormattedTime()
4947
const formattedAction = actionTransformer(action)
5048
const message = `action ${action.type}${formattedTime}`

0 commit comments

Comments
 (0)