Skip to content

Instantly share code, notes, and snippets.

@kanian
Created August 24, 2020 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanian/3ea22dac8297d26c83038c02dd71f21b to your computer and use it in GitHub Desktop.
Save kanian/3ea22dac8297d26c83038c02dd71f21b to your computer and use it in GitHub Desktop.
setProps<T extends BaseObject>(values: PartialOfProperties<T>): void {
for (let prop in values) {
this[prop] =
values[prop] !== undefined ? values[prop] : this[prop];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment