@hypen-space/core 0.4.39 → 0.4.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.d.ts +7 -0
- package/dist/app.js +6 -2
- package/dist/app.js.map +3 -3
- package/dist/components/builtin.js +6 -2
- package/dist/components/builtin.js.map +3 -3
- package/dist/index.browser.js +6 -2
- package/dist/index.browser.js.map +3 -3
- package/dist/index.js +6 -2
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/src/app.ts +13 -2
package/src/app.ts
CHANGED
|
@@ -639,8 +639,19 @@ export class HypenModuleInstance<T extends object = any> {
|
|
|
639
639
|
target[lastSeg] = payload.value;
|
|
640
640
|
});
|
|
641
641
|
|
|
642
|
-
// Call onCreated
|
|
643
|
-
this.callCreatedHandler();
|
|
642
|
+
// Call onCreated — store the promise so callers can await initialization
|
|
643
|
+
this._readyPromise = this.callCreatedHandler();
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/** Promise that resolves when onCreated handler has completed */
|
|
647
|
+
private _readyPromise: Promise<void> = Promise.resolve();
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Wait for the module's onCreated handler to complete.
|
|
651
|
+
* Call this before renderSource to ensure state is fully initialized.
|
|
652
|
+
*/
|
|
653
|
+
async waitForReady(): Promise<void> {
|
|
654
|
+
await this._readyPromise;
|
|
644
655
|
}
|
|
645
656
|
|
|
646
657
|
/**
|