MCPcopy Index your code
hub / github.com/TanStack/db / checkParentStatus

Function checkParentStatus

packages/db/src/proxy.ts:786–808  ·  view source on GitHub ↗
(
    parentState: ChangeTracker<Record<string | symbol, unknown>>,
    childProp: string | symbol | unknown,
  )

Source from the content-addressed store, hash-verified

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 {

Callers 1

setFunction · 0.85

Calls 2

debugLogFunction · 0.85
checkIfRevertedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…