feat(lib/modules/metro/subscriptions): clean up specific subscriptions once called
This commit is contained in:
parent
e6e46a175d
commit
8fcbcb5792
1 changed files with 8 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue