Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable initial migrations, clarify README (#14)
* Allow currentVersion of `0` Previously a `0` would be interpreted as falsy, but I believe the real intent here is to avoid an undefined due to an empty `versionKeys` array. * Allow migrations upon first use of redux-persist-migrate Previously, if there was not already a stored version, migrations would not happen at all. This change allows _all_ migrations to occur, the first time redux-persist-migrate is deployed and users have stored state, but no stored version. I think this is safe, because the only other realistic time the version will be null is when persisted data has been purged, in which case there will be no other `state` to migrate. The only other situation I can think of which might cause problems, is if the developer has not created a reducer at all in which to store the version. In that case, all migrations will be performed, but the new version will not be saved, so the migrations will occur each time. I think the solution to this is to improve the documentation to clarify that a reducer needs to be created to store the version, and that `redux-persist-migrate` will not create any reducers. * Clarify that an existing reducer is needed Fixes #9
- Loading branch information