MCPcopy Index your code
hub / github.com/angular/angular / debounceSync

Method debounceSync

packages/forms/signals/src/field/node.ts:430–453  ·  view source on GitHub ↗

* Initiates a debounced sync. * * If a debouncer is configured, the synchronization will occur after the debouncer resolves. If * no debouncer is configured, the synchronization happens immediately. If controlValue is * updated again while a debounce is pending, the previ

()

Source from the content-addressed store, hash-verified

428 * of the new one.
429 */
430 private async debounceSync() {
431 const debouncer = untracked(() => {
432 this.pendingSync()?.abort();
433 return this.nodeState.debouncer();
434 });
435
436 if (debouncer) {
437 const controller = new AbortController();
438 const promise = debouncer(controller.signal);
439 if (promise) {
440 this.pendingSync.set(controller);
441 await promise;
442 if (controller.signal.aborted) {
443 return; // Do not sync if the debounce was aborted.
444 }
445 }
446 }
447
448 if (this.structure.isOrphaned()) {
449 return;
450 }
451
452 this.sync();
453 }
454
455 /**
456 * Creates a new root field node for a new form.

Callers 1

controlValueSignalMethod · 0.95

Calls 4

syncMethod · 0.95
untrackedFunction · 0.90
abortMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected