Expand description
Compensating event generation for bn undo.
Events are immutable and append-only. undo does not delete or modify
events — it emits compensating events that reverse the observable effect:
| Original event | Compensating event |
|---|---|
item.create | item.delete |
item.update | item.update with prior field value |
item.move | item.move back to prior state |
item.assign(assign) | item.assign(unassign) |
item.assign(unassign) | item.assign(assign) |
item.link | item.unlink |
item.unlink | item.link |
item.delete | item.create (reconstruct from history) |
Events that cannot be undone (grow-only by design):
item.comment— G-Set: comments are permanentitem.compact— compaction is not reversible without original eventsitem.snapshot— same as compactitem.redact— intentionally permanent
Enums§
- Undo
Error - Reason a compensating event cannot be generated.
Functions§
- compensating_
event - Generate a compensating event that reverses the effect of
original.