Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function emitRemovedEvent(stage: PIXI.Container, target: PIXI.DisplayObject): void {
target.dispatchEvent(new Event("removedFromStage", true));
if (target instanceof PIXI.Container) {
target.children.forEach(child => emitRemovedEvent(stage, child));
}
}
function emitAddedEvent(stage: PIXI.Container, target: PIXI.DisplayObject): void {
target.dispatchEvent(new Event("addedToStage", true));
if (target instanceof PIXI.Container) {
target.children.forEach(child => emitAddedEvent(stage, child));
}
}