Skip to content

Conversation

@cherifGsoul
Copy link
Member

Fixes propertyDefaults for observable class fields:

class MyArray extends ObservableArray {

  foo = 4;

  static get propertyDefaults() {
    return type.maybeConvert(String);
  }
}

const anArray = new MyArray();

console.log(anArray.foo); // '4'

anArray.on('foo', (ev, newVal, oldVal) => {
  console.log(newVal); // -> '10'
});

anArray.set(foo, 10);

@cherifGsoul cherifGsoul merged commit 87a8089 into master Jun 18, 2020
@cherifGsoul cherifGsoul deleted the class-fields-propertyDefaults branch June 18, 2020 17:34
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

Successfully merging this pull request may close these issues.

3 participants