The persistence data plugin helps to persist parts of the state in between sessions. When the data persisted is an object (e.g. the preferences key in the editor, nux, or edit-post stores) new keys added to that object will be invalidated once the persistence mechanism retrieves old data from cache.
How to test
- Clean browser application cache, check out
master branch, and run Gutenberg.
- Create a new branch and add some code that adds a new key to the
preferences object whose value is true by default.
- Execute that new branch.
Expected result is that the preferences object will have the new truthy value but instead it has the state retrieved from local storage (which doesn't have the new added key).
The persistence data plugin helps to persist parts of the state in between sessions. When the data persisted is an object (e.g. the
preferenceskey in the editor, nux, or edit-post stores) new keys added to that object will be invalidated once the persistence mechanism retrieves old data from cache.How to test
masterbranch, and run Gutenberg.preferencesobject whose value istrueby default.Expected result is that the
preferencesobject will have the new truthy value but instead it has the state retrieved from local storage (which doesn't have the new added key).