UNPKG

@pixi/react

Version:

Write PixiJS applications using React declarative style.

1 lines 848 B
{"version":3,"file":"removeChild.mjs","sources":["../../src/helpers/removeChild.ts"],"sourcesContent":["import { Filter } from 'pixi.js';\nimport { type HostConfig } from '../typedefs/HostConfig';\nimport { detach } from './detach';\nimport { log } from './log';\n\n/** Removes elements from our scene and disposes of them. */\nexport function removeChild(\n _parentInstance: HostConfig['containerInstance'],\n childInstance: HostConfig['instance'],\n)\n{\n log('info', 'lifecycle::removeChild');\n\n if (childInstance instanceof Filter)\n {\n detach(childInstance);\n }\n\n childInstance.destroy();\n}\n"],"names":[],"mappings":";;;;;AAMgB,SAAA,WAAA,CACZ,iBACA,aAEJ,EAAA;AACI,EAAA,GAAA,CAAI,QAAQ,wBAAwB,CAAA;AAEpC,EAAA,IAAI,yBAAyB,MAC7B,EAAA;AACI,IAAA,MAAA,CAAO,aAAa,CAAA;AAAA;AAGxB,EAAA,aAAA,CAAc,OAAQ,EAAA;AAC1B;;;;"}