Closed oscarchilds closed 2 years ago
Hi @championswimmer @oscarchilds , Thanks for this library, It seems this change and the others after it were not released. The last release was 3.1.3 on npm. was this intentional?
NPM has not seen a release for a while, even though a number of changes have been brought into master for this package. I'd recommend forking your own solution or moving onto another package if we don't see another release to NPM
Fix for issue #213, where I think the issue is explained best, but I'll give it my own try below
RESTORE_MUTATION
function contains a reference tothis.mergeOption
, butthis
seems to be for a different context, causing mergeOption to always be null when using theRESTORE_MUTATION
This creates an issue when restoring arrays from localStorage. Deepmerge defaults to a merge behaviour when merging arrays, but vuex-persist defaults to 'replaceArrays', which ends up not being respected as mergeOption is null, so Deepmerge reverts to it's default of merging arrays.
I've put together an example of the issue in action here
Thanks