Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .changeset/curvy-steps-cancel.md

This file was deleted.

10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# rollbackit

## 1.1.0

### Minor Changes

- 1938483: Add `step()` and timeouts.

- **`step(description, run, rollback, options?)`** — runs a forward action and registers its compensation in one call, registering the rollback only if the action resolves and threading its result into the rollback. Returns whatever `run` returns.
- **Timeouts & cancellation** — bound a single `step` (`StepOptions.timeout`) or the whole operation (`WithRollbackOptions.timeout`). On timeout a `TimeoutError` (a `RollbackError` subclass) is thrown and an `AbortSignal` is fired so in-flight work can cancel; `withRollback` still unwinds whatever was registered before re-throwing. `withRollback`'s callback now receives that signal as its second argument.
- Export `TimeoutError` and the `StepOptions` type.

## 1.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rollbackit",
"type": "module",
"version": "1.0.1",
"version": "1.1.0",
"sideEffects": false,
"description": "Automatic rollback for multi-step operations. Register an undo next to each step; if a later one throws, they unwind in reverse. Zero-dependency, type-safe.",
"author": "Alexandre Marques",
Expand Down
Loading