UNPKG

@pixi/react

Version:

Write PixiJS applications using React declarative style.

1 lines 1.12 kB
{"version":3,"file":"unmountRoot.mjs","sources":["../../src/helpers/unmountRoot.ts"],"sourcesContent":["import { reconciler } from '../core/reconciler';\nimport { roots } from '../core/roots';\nimport { store } from '../store';\nimport { type Root } from '../typedefs/Root';\n\nexport function unmountRoot(root: Root)\n{\n store.unmountQueue.delete(root);\n\n const fiber = root.fiber;\n\n if (fiber)\n {\n reconciler.updateContainer(null, fiber, null, () =>\n {\n if (root.applicationState.app)\n {\n root.applicationState.app.destroy();\n }\n\n roots.delete(root.internalState.canvas!);\n });\n }\n}\n"],"names":[],"mappings":";;;;;AAKO,SAAS,YAAY,IAC5B,EAAA;AACI,EAAM,KAAA,CAAA,YAAA,CAAa,OAAO,IAAI,CAAA;AAE9B,EAAA,MAAM,QAAQ,IAAK,CAAA,KAAA;AAEnB,EAAA,IAAI,KACJ,EAAA;AACI,IAAA,UAAA,CAAW,eAAgB,CAAA,IAAA,EAAM,KAAO,EAAA,IAAA,EAAM,MAC9C;AACI,MAAI,IAAA,IAAA,CAAK,iBAAiB,GAC1B,EAAA;AACI,QAAK,IAAA,CAAA,gBAAA,CAAiB,IAAI,OAAQ,EAAA;AAAA;AAGtC,MAAM,KAAA,CAAA,MAAA,CAAO,IAAK,CAAA,aAAA,CAAc,MAAO,CAAA;AAAA,KAC1C,CAAA;AAAA;AAET;;;;"}