Jul 25, 2017 · 1 min read
Out of curiosity what would you have against using ES6 classes in conjunction with the factory pattern as a static function?
For example:
class User { static factory () { return new User()
}}
This achieves the benefits of using the factory pattern, allows the use of typeof and isolates the creation of an object via the new operator to a single place.