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

Function clearRendererCache

packages/core/src/render3/hmr.ts:216–221  ·  view source on GitHub ↗

* Removes any cached renderers from the factory for the provided type. * This is currently used by the HMR logic to ensure Renderers are kept * synchronized with any definition metadata updates. * @param factory A RendererFactory2 instance. * @param def A ComponentDef instance.

(factory: RendererFactory, def: ComponentDef<unknown>)

Source from the content-addressed store, hash-verified

214 * @param def A ComponentDef instance.
215 */
216function clearRendererCache(factory: RendererFactory, def: ComponentDef<unknown>) {
217 // Cast to read a private field.
218 // NOTE: This must be kept synchronized with the renderer factory implementation in
219 // platform-browser and platform-browser/animations.
220 (factory as {componentReplaced?: (id: string) => void}).componentReplaced?.(def.id);
221}
222
223/**
224 * Recreates an LView in-place from a new component definition.

Callers 1

recreateFunction · 0.85

Calls 1

componentReplacedMethod · 0.45

Tested by

no test coverage detected