MCPcopy
hub / github.com/stutrek/scrollmonitor / create

Method create

src/container.ts:221–233  ·  view source on GitHub ↗
(input: WatchItemInput, offsets?: Offsets)

Source from the content-addressed store, hash-verified

219 }
220
221 create(input: WatchItemInput, offsets?: Offsets) {
222 let item: WatchItem;
223 if (typeof item === 'string') {
224 item = document.querySelector(item);
225 } else if (Array.isArray(input) || input instanceof NodeList) {
226 item = input[0] as HTMLElement;
227 } else {
228 item = input as WatchItem;
229 }
230 var watcher = new Watcher(this, item, offsets);
231 this.watchers.push(watcher);
232 return watcher;
233 }
234
235 /**
236 * @deprecated since version 1.1

Callers 3

begetMethod · 0.95
tests.jsFile · 0.80
constructorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected