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 "oldValue" to a patch #28

Open
dntzhang opened this issue Nov 6, 2018 · 1 comment
Open

Add "oldValue" to a patch #28

dntzhang opened this issue Nov 6, 2018 · 1 comment

Comments

@dntzhang
Copy link

dntzhang commented Nov 6, 2018

https://github.com/Tencent/omi

Hope to support oldValue:

{op: "replace", path: "/a/b", value: "aaa2", oldValue: "aaa1"}

If it is convenient, you can review this for omi. I added only one line of code.
https://github.com/Tencent/omi/blob/master/packages/omi/src/proxy.js#L149

@warpech warpech changed the title no issues just thanks Add "oldValue" to a patch Mar 25, 2019
@warpech
Copy link
Contributor

warpech commented Mar 25, 2019

Thanks @dntzhang for the kind words. I took the liberty to rename the title to reflect the content of your comment.

oldValue is not part of the JSON Patch standard, but maybe we could either:

  1. implement this as a non-enumerable property
  2. or, add it as a second argument to the observed callback

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