Check if options exist in emitChange

This commit is contained in:
RMidhunSuresh 2022-02-17 11:30:04 +05:30
parent 61b264be3b
commit 498a43327f

View file

@ -110,7 +110,7 @@ export class ViewModel<O extends Options = Options> extends EventEmitter<{change
}
emitChange(changedProps: any): void {
if (this._options.emitChange) {
if (this._options?.emitChange) {
this._options.emitChange(changedProps);
} else {
this.emit("change", changedProps);