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