Skip to content

Commit 211c923

Browse files
fix(overmind): improve merging of hot reloaded state
1 parent fb831f3 commit 211c923

File tree

1 file changed

+2
-1
lines changed
  • packages/node_modules/overmind/src

1 file changed

+2
-1
lines changed

packages/node_modules/overmind/src/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ export function mergeState(originState, oldState, nextState) {
5959
function merge(origin, old, next) {
6060
if (isPlainObject(old) && isPlainObject(next)) {
6161
const newBranch = {}
62+
const keys = Object.keys(old).concat(Object.keys(next))
6263

63-
for (let key in next) {
64+
for (let key of keys) {
6465
newBranch[key] = merge(origin[key], old[key], next[key])
6566
}
6667

0 commit comments

Comments
 (0)