![]() ![]() 13.1 The problem: initializing a property asynchronously The focus of this chapter is on classes, which is why alternatives to classes are ignored. We do so by solving one concrete problem several times. In this chapter, we examine several approaches for creating instances of classes: Constructors, factory functions, etc. 13.4 Subclassing a Promise-based constructor (optional).13.3.4 Variant: separate factory function.13.3.3 Improvement: instances are inactive by default, activated by factory method.13.3.2 Improvement: constructor throws, factory method borrows the class prototype.13.3.1 Improvement: private constructor via secret token. ![]() 13.2.1 Using an immediately-invoked asynchronous arrow function. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |