Skip to content

binding to a property getter uses dirty-checking #37

Closed
@frankwallis

Description

@frankwallis

In the skeleton-navigation example app some text is bound to an es5 property

<div class="form-group">
    <label>Full Name</label>
    <p class="help-block">${fullName | upper}</p>
</div>
export class Welcome{
  constructor(){
    this.heading = 'Welcome to the Aurelia Navigation App!';
    this.firstName = 'John';
    this.lastName = 'Doe';
  }

  get fullName(){
    return `${this.firstName} ${this.lastName}`;
  }
  ...
}

When I run the app (in chrome) I can see that the fullName getter is called roughly every 120ms, despite nothing changing. So it appears to be 'falling back' to dirty-checking. Is this the expected behaviour, and is there another way to write this code so that the binding uses one of the more efficient binding mechanisms?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions