Function: createMergeChangeSet()

createMergeChangeSet(args): Promise<{ id: LixGenerated<string>; metadata?: null | Record<string, any>; }>

Merges two change sets using a "source wins" strategy (until lix models conflicts).

Creates a new change set containing the merged result. If an element (identified by entity_id, file_id, schema_key) exists in both the source and target change sets (considering their respective histories), the element from the source change set's history takes precedence.

Parameters

args

The arguments for the merge operation.

lix

Lix

The Lix instance.

source

Pick<ChangeSet, "id">

The source change set (only id is needed).

target

Pick<ChangeSet, "id">

The target change set (only id is needed).

Returns

Promise<{ id: LixGenerated<string>; metadata?: null | Record<string, any>; }>

A Promise resolving to the newly created ChangeSet representing the merged state.