Skip to content

Commit

Permalink
return inbound if we're not able to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
EskiMojo14 committed Jan 26, 2024
1 parent 82f6f09 commit 7d6ea89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/toolkit/src/persistor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const shallowMerge = <State>(
original: State | undefined,
reduced: State
): State => {
if (!isPlainObject(reduced)) return reduced
if (!isPlainObject(reduced)) return inbound
const newState: State = { ...reduced }
if (isPlainObject(inbound)) {
const keys = Object.keys(inbound) as (keyof State)[]
Expand All @@ -125,7 +125,7 @@ export const twoLevelMerge = <State>(
original: State | undefined,
reduced: State
) => {
if (!isPlainObject(reduced)) return reduced
if (!isPlainObject(reduced)) return inbound
const newState: State = { ...reduced }
if (isPlainObject(inbound)) {
const keys = Object.keys(inbound) as (keyof State)[]
Expand Down

0 comments on commit 7d6ea89

Please sign in to comment.