* Creates a linked signal that initiates a debounceSync when set.
()
| 379 | * Creates a linked signal that initiates a {@link debounceSync} when set. |
| 380 | */ |
| 381 | private controlValueSignal(): ControlValueSignal<unknown> { |
| 382 | const controlValue = linkedSignal(this.value) as ControlValueSignal<unknown>; |
| 383 | |
| 384 | controlValue.rawSet = controlValue.set; |
| 385 | controlValue.set = (newValue) => { |
| 386 | // We intentionally allow same-value updates here to ensure that setting the control value |
| 387 | // (even to the same value) still marks the control as dirty. |
| 388 | controlValue.rawSet(newValue); |
| 389 | this.markAsDirty(); |
| 390 | this.debounceSync(); |
| 391 | }; |
| 392 | const rawUpdate = controlValue.update; |
| 393 | controlValue.update = (updateFn) => { |
| 394 | // We intentionally allow same-value updates here to ensure that updating the control value |
| 395 | // (even to the same value) still marks the control as dirty. |
| 396 | rawUpdate(updateFn); |
| 397 | this.markAsDirty(); |
| 398 | this.debounceSync(); |
| 399 | }; |
| 400 | |
| 401 | return controlValue; |
| 402 | } |
| 403 | |
| 404 | /** |
| 405 | * Synchronizes the {@link controlValue} with the {@link value} signal immediately. |
no test coverage detected