-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
Hi all! I want to perform this factory class behaviour, but when I call new S()
, a promise is returned. Do I do something wrong? May this feature is not present for being used as factory?
const factory: ObjectFactory = async () => S.getInstance();
@Factory(factory)
export class S {
private static _instance: S;
static async getInstance(): Promise<S> {
if (!this._instance) {
this._instance = new S();
await this._instance.createClient();
}
return this._instance;
}
async createClient(): Promise<void> {
this._client = await createClientAsync('url');
}
}
Thank you all in advance!
TheOnlyMrFlow
Metadata
Metadata
Assignees
Labels
No labels