MCPcopy Create free account
hub / github.com/angular/angular / asyncDestroyPlatform

Function asyncDestroyPlatform

packages/platform-server/src/utils.ts:269–286  ·  view source on GitHub ↗

* Destroy the application in a macrotask, this allows pending promises to be settled and errors * to be surfaced to the users.

(platformRef: PlatformRef)

Source from the content-addressed store, hash-verified

267 * to be surfaced to the users.
268 */
269function asyncDestroyPlatform(platformRef: PlatformRef): Promise<void> {
270 if (platformRef.destroyed) {
271 return Promise.resolve();
272 }
273
274 return new Promise<void>((resolve, reject) => {
275 setTimeout(() => {
276 try {
277 if (!platformRef.destroyed) {
278 platformRef.destroy();
279 }
280 resolve();
281 } catch (error) {
282 reject(error);
283 }
284 }, 0);
285 });
286}
287
288/**
289 * Specifies the value that should be used if no server context value has been provided.

Callers 2

renderModuleFunction · 0.85
renderApplicationFunction · 0.85

Calls 5

setTimeoutFunction · 0.85
rejectFunction · 0.85
resolveMethod · 0.65
destroyMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected