Last active
October 2, 2021 15:30
-
-
Save hatelove/d1b1eb1fbdd166fd37458dfb9af0d5e7 to your computer and use it in GitHub Desktop.
factory method of class from json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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