File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/node_modules/overmind/src Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -952,21 +952,23 @@ export class Overmind<ThisConfig extends IConfiguration>
952952 this . actions = this . getActions ( configuration . actions )
953953 this . effects = configuration . effects || { }
954954
955+ const mutationTree = this . proxyStateTree . getMutationTree ( )
955956 // We change the state to match the new structure
956- rehydrate ( this . state as any , changeMutations )
957+ rehydrate ( mutationTree . state as any , changeMutations )
957958
958959 // We run any mutations ran during the session, it might fail though
959960 // as the state structure might have changed, but no worries we just
960961 // ignore that
961962 this . reydrateMutationsForHotReloading . forEach ( ( mutation ) => {
962963 try {
963- rehydrate ( this . state as any , [ mutation ] )
964+ rehydrate ( mutationTree . state as any , [ mutation ] )
964965 } catch ( error ) {
965966 // No worries, structure changed and we do not want to mutate anyways
966967 }
967968 } )
968969
969- this . proxyStateTree . forceFlush ( )
970+ mutationTree . flush ( )
971+ mutationTree . dispose ( )
970972
971973 if ( this . devtools ) {
972974 this . devtools . send ( {
You can’t perform that action at this time.
0 commit comments