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

Should Ignore member functions #93

Open
childrentime opened this issue Sep 1, 2023 · 0 comments
Open

Should Ignore member functions #93

childrentime opened this issue Sep 1, 2023 · 0 comments

Comments

@childrentime
Copy link

It appears that it does not ignore member functions, but in reality, member functions are not necessary to be included in the patch result, and patch also resets member functions.

export class ChildStore<R> {
  /** we don't need patch this, but it will*/
  private getRoot: () => R;

  get $root() {
    return this.getRoot();
  }

  constructor(root: R) {
    this.getRoot = () => root;
  }
}

result:

[
  {
    op: 'add',
    path: '/childStore/getRoot',
    value: [Function (anonymous)]
  }
]

I think we should check if the value is a function and filter it out.

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

1 participant