feat(lib/modules/metro/subscriptions): clean up specific subscriptions once called

This commit is contained in:
PalmDevs 2025-04-15 15:04:35 +07:00
parent e6e46a175d
commit 8fcbcb5792
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -12,13 +12,19 @@ export const _importedPath = new Set<ModuleWithImportedPathInitializedCallback>(
export function _executeRequiredSubscription() {
const id = _mInitingId
for (const cb of _reqAll) cb(id)
if (_reqSpecific.has(id)) for (const cb of _reqSpecific.get(id)!) cb(id)
if (_reqSpecific.has(id)) {
for (const cb of _reqSpecific.get(id)!) cb(id)
_reqSpecific.delete(id)
}
}
export function _executeInitializedSubscription(exports: Metro.ModuleExports) {
const id = _mInitingId
for (const cb of _initAll) cb(id, exports)
if (_initSpecific.has(id)) for (const cb of _initSpecific.get(id)!) cb(id, exports)
if (_initSpecific.has(id)) {
for (const cb of _initSpecific.get(id)!) cb(id, exports)
_initSpecific.delete(id)
}
}
export function _executeImportedPathSubscription(path: string) {