@rt2zz I played around with using merge levels 1 and 2 with both nested and non-nested reducers. I didn't see any problems with using autoMergeLevel2 in all cases.
I think you are correct, and I think we will make level2 the default (although that is breaking and will require v6.
The only requirement before we make that switch is we need to tests to ensure that things behave as expected when substate is: a primitive, null, undefined, or non-plain object.
Can we also have autoMergeLevel3?
yes theoretically we could create level 3+, or even deepMerge although I am not sure in what usage that would be useful?
If anyone has suggestions for a better api to expose this I am all ears. It would be nice to do something like
let persistorConfig = {
mergeLevel: 2
}
but then we lose the ability for tree shaking to reduce bundle size by avoiding inclusion of unnecessary reconciler code.
Most helpful comment
Can we also have autoMergeLevel3?