event.ts ×4

Frontier kind: Code frontier

unlabeled · c_ce667211e7be

155 tests · 7056 LOC · 31 files · introduces 0 tests · 27 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges27 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1045 ranges7056 lines · 31 files · Browse complete extent
All tests (intent)
155 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 27 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/base/common/event.ts 27 introduced LOC · 4 ranges

Open complete file

268 export function debounce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, delay?: number | typeof MicrotaskDelay, leading?: boolean, flushOnListenerRemove?: boolean, leakWarningThreshold?: number, disposable?: DisposableStore): Event<O>;
269 export function debounce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, delay: number | typeof MicrotaskDelay = 100, leading = false, flushOnListenerRemove = false, leakWarningThreshold?: number, disposable?: DisposableStore): Event<O> {
270 > let subscription: IDisposable; event.ts
271 > let output: O | undefined = undefined;
272 > let handle: Timeout | undefined | null = undefined;
273 > let numDebouncedCalls = 0;
274 > let doFire: (() => void) | undefined;
275 >
276 > const options: EmitterOptions | undefined = {
277 > leakWarningThreshold,
278 > onWillAddFirstListener() {
279 > subscription = event(cur => {
280 numDebouncedCalls++;
281 output = merge(output, cur);
307 }
308 }
309 > }); event.ts
310 > },
311 > onWillRemoveListener() {
312 if (flushOnListenerRemove && numDebouncedCalls > 0) {
313 doFire?.();
314 }
315 },
316 > onDidRemoveLastListener() { event.ts
317 > doFire = undefined;
318 > subscription.dispose();
319 > }
320 > };
321 >
322 > if (!disposable) {
323 _addLeakageTraceLogic(options);
324 }
325 > event.ts
326 > const emitter = new Emitter<O>(options);
327 >
328 > disposable?.add(emitter);
329 >
330 > return emitter.event;
331 > }
332
333 /**