dynamic-forms / Function

determineDifferentialOperation

Determines the optimal differential update operation based on current and new state.

Operations:

  • Clear all (empty array)
  • Initial render (no existing items)
  • Append only (items added at end)
  • Pop only (items removed from end)
  • None (same length - items update via linkedSignal)

Presentation

function determineDifferentialOperation(
  currentItems: ResolvedArrayItem[],
  newLength: number,
): DifferentialUpdateOperation;

Returns

Parameters

NameTypeDescription
currentItems
ResolvedArrayItem[]
newLength
number