()
| 203 | * from the DOM. |
| 204 | */ |
| 205 | const cleanUpStyleSheets = () => { |
| 206 | stylesheets.forEach((stylesheet) => { |
| 207 | /** |
| 208 | * When sharing stylesheets, it's possible |
| 209 | * for another animation to have already |
| 210 | * cleaned up a particular stylesheet |
| 211 | */ |
| 212 | if (stylesheet?.parentNode) { |
| 213 | stylesheet.parentNode.removeChild(stylesheet); |
| 214 | } |
| 215 | }); |
| 216 | |
| 217 | stylesheets.length = 0; |
| 218 | }; |
| 219 | |
| 220 | const beforeAddRead = (readFn: AnimationReadWriteCallback) => { |
| 221 | _beforeAddReadFunctions.push(readFn); |