* Gracefully destroys the application in a macrotask, allowing pending promises to resolve * and surfacing any potential errors to the user. * * @param platformRef - The platform reference to be destroyed.
(platformRef: PlatformRef)
| 177 | * @param platformRef - The platform reference to be destroyed. |
| 178 | */ |
| 179 | function asyncDestroyPlatform(platformRef: PlatformRef): Promise<void> { |
| 180 | return new Promise((resolve) => { |
| 181 | setTimeout(() => { |
| 182 | if (!platformRef.destroyed) { |
| 183 | platformRef.destroy(); |
| 184 | } |
| 185 | |
| 186 | resolve(); |
| 187 | }, 0); |
| 188 | }); |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * Constructs a normalized and serialized URL string from its components. |
no test coverage detected