🎨 improve code (#1459)

This commit is contained in:
careyke 2021-05-22 19:35:53 +08:00 committed by GitHub
parent 00e0a8cead
commit 43e50f19e7

View File

@ -58,8 +58,8 @@ export function getMicroAppStateActions(id: string, isMaster?: boolean): MicroAp
console.warn(`[qiankun] '${id}' global listener already exists before this, new listener will overwrite it.`); console.warn(`[qiankun] '${id}' global listener already exists before this, new listener will overwrite it.`);
} }
deps[id] = callback; deps[id] = callback;
const cloneState = cloneDeep(globalState);
if (fireImmediately) { if (fireImmediately) {
const cloneState = cloneDeep(globalState);
callback(cloneState, cloneState); callback(cloneState, cloneState);
} }
}, },