MCPcopy Create free account
hub / github.com/TheOrcDev/github-creature / init

Method init

components/liquid-ether.tsx:198–215  ·  view source on GitHub ↗
(container: HTMLElement)

Source from the content-addressed store, hash-verified

196 private _onTouchEnd = this.onTouchEnd.bind(this);
197 private _onDocumentLeave = this.onDocumentLeave.bind(this);
198 init(container: HTMLElement) {
199 this.container = container;
200 this.docTarget = container.ownerDocument || null;
201 const defaultView =
202 this.docTarget?.defaultView ||
203 (typeof window !== "undefined" ? window : null);
204 if (!defaultView) return;
205 this.listenerTarget = defaultView;
206 this.listenerTarget.addEventListener("mousemove", this._onMouseMove);
207 this.listenerTarget.addEventListener("touchstart", this._onTouchStart, {
208 passive: true,
209 });
210 this.listenerTarget.addEventListener("touchmove", this._onTouchMove, {
211 passive: true,
212 });
213 this.listenerTarget.addEventListener("touchend", this._onTouchEnd);
214 this.docTarget?.addEventListener("mouseleave", this._onDocumentLeave);
215 }
216 dispose() {
217 if (this.listenerTarget) {
218 this.listenerTarget.removeEventListener(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected