Skip to content

Commit c02667d

Browse files
fix(overmind): fix state hot reload with adding and removal of key
1 parent 8589393 commit c02667d

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

packages/node_modules/overmind/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,7 @@ export class Overmind<ThisConfig extends IConfiguration>
850850
),
851851
}
852852
const proxyStateTree = this.proxyStateTree as any
853+
this.originalConfiguration.state = configuration.state
853854
this.proxyStateTree.sourceState = this.getState(mergedConfiguration)
854855
proxyStateTree.createTrackStateProxifier()
855856
this.state = this.proxyStateTree.state as any

packages/node_modules/overmind/src/utils.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@ export function mergeState(originState, oldState, nextState) {
7878
return old
7979
}
8080

81-
// If we remove a key we return undefined to remove it
82-
if (next === undefined) {
83-
return next
84-
}
85-
8681
// If we have changed a state from origin, keep that
8782
// changed state
8883
if (next === origin && old !== origin) {

0 commit comments

Comments
 (0)