Skip to content

Add aurelia-typed-observable-plugin dependency #299

@MaximBalaganskiy

Description

@MaximBalaganskiy

It would be great to use aurelia-typed-observable-plugin in UX components.
At the moment, whenever we need a boolean or a number property, a lot of plumbing code is needed to convert strings to typed values.

E.g.

  debounceNumber: number | null | undefined = this.defaultConfiguration.debounce;
  @bindable
  debounce: number | string | undefined = this.defaultConfiguration.debounce;
  debounceChanged() {
    this.debounceNumber = normalizeNumberAttribute(this.debounce);
  }

As you can see, far from convenient. Plus, I need to remember to use a shadow property instead of a bindable directly.

With the plugin this becomes just

  @bindable // this is plugin's bindable
  debounce: number = this.defaultConfiguration.debounce;

The advantage is obvious

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions