(
parentState: ChangeTracker<Record<string | symbol, unknown>>,
childProp: string | symbol | unknown,
)
| 784 | |
| 785 | // Update parent status based on child changes |
| 786 | function checkParentStatus( |
| 787 | parentState: ChangeTracker<Record<string | symbol, unknown>>, |
| 788 | childProp: string | symbol | unknown, |
| 789 | ) { |
| 790 | debugLog(`checkParentStatus called for child prop:`, childProp) |
| 791 | |
| 792 | // Check if all properties of the parent are reverted |
| 793 | const isReverted = checkIfReverted(parentState) |
| 794 | debugLog(`Parent checkIfReverted returned:`, isReverted) |
| 795 | |
| 796 | if (isReverted) { |
| 797 | debugLog(`Parent is fully reverted, clearing tracking`) |
| 798 | // If everything is reverted, clear the tracking |
| 799 | parentState.modified = false |
| 800 | parentState.assigned_ = {} |
| 801 | |
| 802 | // Continue up the chain |
| 803 | if (parentState.parent) { |
| 804 | debugLog(`Continuing up the parent chain`) |
| 805 | checkParentStatus(parentState.parent.tracker, parentState.parent.prop) |
| 806 | } |
| 807 | } |
| 808 | } |
| 809 | |
| 810 | // Create a proxy for the target object |
| 811 | function createObjectProxy<TObj extends object>(obj: TObj): TObj { |
no test coverage detected
searching dependent graphs…