🏁 use promise.catch to simulate promise.finally for compatible reason (#1664)
Co-authored-by: chemdemo <chemdemo@gmail.com>
This commit is contained in:
parent
69af3a1be4
commit
a5f7426e53
|
|
@ -167,13 +167,15 @@ export function loadMicroApp<T extends ObjectType>(
|
|||
microAppsRef.push(microApp);
|
||||
containerMicroAppsMap.set(key, microAppsRef);
|
||||
|
||||
// gc after unmount
|
||||
microApp.unmountPromise.finally(() => {
|
||||
const cleanApp = () => {
|
||||
const index = microAppsRef.indexOf(microApp);
|
||||
microAppsRef.splice(index, 1);
|
||||
// @ts-ignore
|
||||
microApp = null;
|
||||
});
|
||||
};
|
||||
|
||||
// gc after unmount
|
||||
microApp.unmountPromise.then(cleanApp).catch(cleanApp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user