Function: createUndoChangeSet()

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

Creates a "reverse" change set that undoes the changes made by the specified change set.

Parameters

args

changeSet

Pick<ChangeSet, "id">

labels?

Pick<{ id: LixGenerated<string>; name: string; }, "id">[]

lix

Lix

Returns

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

The newly created change set that contains the undo operations

Example

const undoChangeSet = await createUndoChangeSet({
    lix,
    changeSet: targetChangeSet
  });

  await applyChangeSet({
    lix,
    changeSet: undoChangeSet
  });