MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / waitForEvent

Function waitForEvent

core/src/components/range/test/range.spec.ts:6–7  ·  view source on GitHub ↗
(el: HTMLElement, eventName: string)

Source from the content-addressed store, hash-verified

4import { Range } from '../range';
5
6const waitForEvent = (el: HTMLElement, eventName: string) =>
7 new Promise<void>((resolve) => el.addEventListener(eventName, () => resolve(), { once: true }));
8
9let sharedRange: Range;
10

Callers 1

range.spec.tsFile · 0.85

Calls 2

resolveFunction · 0.85
addEventListenerMethod · 0.65

Tested by

no test coverage detected