Skip to content

Should Ignore member functions #93

Description

@childrentime

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions