Skip to content

Commit 989dba0

Browse files
committed
#7076 WIP
1 parent 6a87312 commit 989dba0

2 files changed

Lines changed: 21 additions & 29 deletions

File tree

src/component/Base.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,6 @@ class Component extends Base {
371371
* @protected
372372
*/
373373
isAwaitingMount = false
374-
/**
375-
* @member {Function[]} resolveUpdateCache=[]
376-
*/
377-
resolveUpdateCache = []
378374

379375
/**
380376
* Convenience shortcut to access the App this component belongs to

src/functional/component/Base.mjs

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -85,36 +85,32 @@ class FunctionalBase extends Base {
8585
* @private
8686
*/
8787
#nextChildComponents = null
88+
8889
/**
89-
* @member {Function[]} resolveUpdateCache=[]
90+
* A Promise that resolves when the component is mounted to the DOM.
91+
* This provides a convenient way to wait for the component to be fully
92+
* available and interactive before executing subsequent logic.
93+
*
94+
* It also handles unmounting by resetting the promise, so it can be safely
95+
* awaited again if the component is remounted.
96+
* @returns {Promise<Neo.component.Base>}
9097
*/
91-
resolveUpdateCache = []
92-
93-
/**
94-
* A Promise that resolves when the component is mounted to the DOM.
95-
* This provides a convenient way to wait for the component to be fully
96-
* available and interactive before executing subsequent logic.
97-
*
98-
* It also handles unmounting by resetting the promise, so it can be safely
99-
* awaited again if the component is remounted.
100-
* @returns {Promise<Neo.component.Base>}
101-
*/
102-
get mountedPromise() {
103-
let me = this;
104-
105-
if (!me._mountedPromise) {
106-
me._mountedPromise = new Promise(resolve => {
107-
if (me.mounted) {
108-
resolve(me);
109-
} else {
110-
me.mountedPromiseResolve = resolve
111-
}
112-
})
113-
}
98+
get mountedPromise() {
99+
let me = this;
114100

115-
return me._mountedPromise
101+
if (!me._mountedPromise) {
102+
me._mountedPromise = new Promise(resolve => {
103+
if (me.mounted) {
104+
resolve(me);
105+
} else {
106+
me.mountedPromiseResolve = resolve
107+
}
108+
})
116109
}
117110

111+
return me._mountedPromise
112+
}
113+
118114
/**
119115
* Convenience method to access the parent component
120116
* @returns {Neo.component.Base|null}

0 commit comments

Comments
 (0)