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

Doesn't work in parent class of inherited @customElement #1

Open
sousekd opened this issue Nov 25, 2020 · 1 comment
Open

Doesn't work in parent class of inherited @customElement #1

sousekd opened this issue Nov 25, 2020 · 1 comment

Comments

@sousekd
Copy link

sousekd commented Nov 25, 2020

Works great, but I have found that the when it is used on a method in a base class of inherited custom element, it doesn't work. I have specifically used it to observe @deepComputed property, but the issue may affect other scenarios, too:

@customElement('child-element')
export class Child extends Parent<XYZ> {
  @bindable childProperty;
}

export abstract class Parent<TModel> {
   @bindable parentProperty : TModel;

   @deepComputedFrom('parentProperty')
   get computedParent() {
      return JSON.stringify(this.parentProperty);
   }
   
   @watch('computedParent') // either of these doesn't work here
   @watch(x: Parent => x.computedParent) 
   computedParentChanged() {
      // this will never get executed
   }
}

When the method with @watch decorator is moved over to Child class, it works.

@bigopon
Copy link
Owner

bigopon commented Nov 28, 2020

Thanks for the issue. This should be simple to fix.

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