Optional
Predict the optimistic result returned immediately to the caller. If omitted, returns { ok: true, value: undefined } as the optimistic result.
{ ok: true, value: undefined }
Called when the real handler fails and the undo handler runs. Use this to notify the UI of the rollback (e.g. show a toast).
Called when the undo handler itself throws during rollback. If omitted, errors are logged to console.error.
Predict the optimistic result returned immediately to the caller. If omitted, returns
{ ok: true, value: undefined }as the optimistic result.