We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c13686 commit 715a8d5Copy full SHA for 715a8d5
src/backend/hook.js
@@ -99,6 +99,11 @@ export function installHook (target) {
99
hook.once('vuex:init', store => {
100
hook.store = store
101
hook.initialState = clone(store.state)
102
+ const origReplaceState = store.replaceState.bind(store)
103
+ store.replaceState = state => {
104
+ hook.initialState = clone(state)
105
+ origReplaceState(state)
106
+ }
107
// Dynamic modules
108
let origRegister, origUnregister
109
if (store.registerModule) {
@@ -121,6 +126,7 @@ export function installHook (target) {
121
126
}
122
127
123
128
hook.flushStoreModules = () => {
129
+ store.replaceState = origReplaceState
124
130
125
131
store.registerModule = origRegister
132
store.unregisterModule = origUnregister
0 commit comments