MCPcopy
hub / github.com/lit/lit / ElementPart

Class ElementPart

packages/lit-html/src/lit-html.ts:2117–2158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2115
2116export type {ElementPart};
2117class ElementPart implements Disconnectable {
2118 readonly type = ELEMENT_PART;
2119
2120 /** @internal */
2121 __directive?: Directive;
2122
2123 // This is to ensure that every Part has a _$committedValue
2124 _$committedValue: undefined;
2125
2126 /** @internal */
2127 _$parent!: Disconnectable;
2128
2129 /** @internal */
2130 _$disconnectableChildren?: Set<Disconnectable> = undefined;
2131
2132 options: RenderOptions | undefined;
2133
2134 constructor(
2135 public element: Element,
2136 parent: Disconnectable,
2137 options: RenderOptions | undefined
2138 ) {
2139 this._$parent = parent;
2140 this.options = options;
2141 }
2142
2143 // See comment in Disconnectable interface for why this is a getter
2144 get _$isConnected() {
2145 return this._$parent._$isConnected;
2146 }
2147
2148 _$setValue(value: unknown): void {
2149 debugLogEvent &&
2150 debugLogEvent({
2151 kind: 'commit to element binding',
2152 element: this.element,
2153 value,
2154 options: this.options,
2155 });
2156 resolveDirective(this, value);
2157 }
2158}
2159
2160/**
2161 * END USERS SHOULD NOT RELY ON THIS OBJECT.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…