Skip to content

Set default to null / undefined without type

Compare
Choose a tag to compare
@cherifGsoul cherifGsoul released this 11 Dec 18:38
· 10 commits to master since this release

This fixes setting property value to null or undefined, for example:

class Foo extends ObservableObject() {
    static get props() {
       return {
	 nullProp: { default: null },
	 undefinedProp: { default: undefined }
      };
   }
}

var foo = new Foo();

foo.nullProp // -> null
foo.undefinedProp // -> undefined

and

class Foo extends ObservableObject() {
    static get props() {
       return {
	 nullProp:  null ,
	 undefinedProp: undefined
      };
   }
}

var foo = new Foo();

foo.nullProp // -> null
foo.undefinedProp // -> undefined

#154