Skip to content

Instantly share code, notes, and snippets.

@hatelove
Last active October 2, 2021 15:30
Show Gist options
  • Save hatelove/d1b1eb1fbdd166fd37458dfb9af0d5e7 to your computer and use it in GitHub Desktop.
Save hatelove/d1b1eb1fbdd166fd37458dfb9af0d5e7 to your computer and use it in GitHub Desktop.
factory method of class from json
class Order {
static from(json) {
return json ? Object.assign(new Order(), json) : null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment