We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is a suggestion to be able to omit nested values in the state.
Example omit: ['editor.color'] instead of just omit: ['editor']
omit: ['editor.color']
omit: ['editor']
I tested this out and this seems to work, but I am not completely sure if this is all that is needed or if there is something else I may have missed.
function removeOmittedKeys( options: Options, store: Store, serializer: Serializer = { serialize: JSON.stringify, deserialize: JSON.parse }, ): Store['$state'] { const clone = serializer.deserialize(serializer.serialize(store.$state)) if (options.undo && options.undo.omit) { options.undo.omit.forEach((key) => { if (key.includes('.')) { const keys = key.split('.') let obj = clone for (let i = 0; i < keys.length - 1; i++) { obj = obj[keys[i]] } delete obj[keys[keys.length - 1]] return } delete clone[key] }) return clone } return clone }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This is a suggestion to be able to omit nested values in the state.
Example
omit: ['editor.color']
instead of justomit: ['editor']
I tested this out and this seems to work, but I am not completely sure if this is all that is needed or if there is something else I may have missed.
The text was updated successfully, but these errors were encountered: