Skip to content

Commit d83f86a

Browse files
author
Guillaume Chau
committed
perf(vuex): less snapshot parsing
1 parent 92aa8ca commit d83f86a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/devtools/views/vuex/module.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ const mutations = {
7373
},
7474

7575
'UPDATE_INSPECTED_STATE' (state, value) {
76-
state.inspectedState = value
76+
state.inspectedState = parse(value)
7777
},
7878

7979
'RECEIVE_STATE' (state, { index, snapshot }) {
80-
state.lastReceivedState = snapshot
80+
state.lastReceivedState = parse(snapshot)
8181
snapshotsCache.set(index, snapshot)
8282
},
8383

8484
'UPDATE_BASE_STATE' (state, value) {
85-
state.base = value
85+
state.base = parse(value)
8686
},
8787

8888
'TIME_TRAVEL' (state, index) {
@@ -135,11 +135,8 @@ const getters = {
135135

136136
const data = entry ? inspectedState : base
137137
if (data) {
138-
const snapshot = parse(data)
139-
if (snapshot) {
140-
res.state = snapshot.state
141-
res.getters = snapshot.getters
142-
}
138+
res.state = data.state
139+
res.getters = data.getters
143140
}
144141

145142
return res

0 commit comments

Comments
 (0)