Creates an async factory for a class such that its _init method is called and awaited before the instantiated object is returned.
_init
Rest
class Api { constructor(foo, bar) { ... } async _init() { await some_initialization_logic(); } ...}export const create_api = create_async_factory(Api); Copy
class Api { constructor(foo, bar) { ... } async _init() { await some_initialization_logic(); } ...}export const create_api = create_async_factory(Api);
Generated using TypeDoc
Creates an async factory for a class such that its
_init
method is called and awaited before the instantiated object is returned.