Skip to content
New issue

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

Add a more ergonomic structure to represent the changes structure #144

Open
NullVoxPopuli opened this issue Dec 3, 2021 · 1 comment
Open

Comments

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Dec 3, 2021

Reference: https://runkit.com/nullvoxpopuli/how-to-use-changeset-data-and-changes

instead of .changes being:

[ {key: "foo", value: 1}, Object {key: "bar", value: "there"}, …]

it should be something easier to understand in isolation, like:

{
  "foo": {
    original: 0,
    current: 1,
  },
  "property.path.0.deep": {
    original: 'hello',
    current: 'there'
 }
}

now, this can easily be computed from the existing .changes, but I think because it is a common desire to build this structure, it should be provided out of the box. maybe via:

changeset.changedValues;
@snewcomer
Copy link
Collaborator

This seems like a good suggestion. We could start with changedValues and do a switcharoo with changes in a major. I'm in favor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants