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
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Saborter Changelog

## v2.4.0
## v2.4.0 (April 23th, 2026)

## New Features
### New Features

- Added `isTimeoutError` function to determine whether the given error is a timeout error.
- Added `Provision API` that injects the `Aborter` context into the `Http API`.
- Added `isTimeoutError` function to determine whether the given error is a timeout error [#80](https://github.com/TENSIILE/saborter/pull/82/changes/9adbc0237df3944b21cb60488105b0238d36d10d)
- Added `Provision API` that injects the `Aborter` context into the `Http API` [#81](https://github.com/TENSIILE/saborter/pull/82/changes/7b9a6ce4f8050aceb6c3e1c13d93a42c41b9a497)

## v2.3.0 (April 15th, 2026)

Expand Down
8 changes: 4 additions & 4 deletions integrations/project/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion integrations/project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"react": "^19.2.0",
"react-dom": "^19.2.0",
"saborter": "file:../../unreleased-packages/saborter-2.3.0.tgz"
"saborter": "file:../../unreleased-packages/saborter-2.4.0.tgz"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
Expand Down
2 changes: 1 addition & 1 deletion integrations/project/src/app.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const App = () => {
};

const handleCancel = () => {
// postsAborter.abort();
postsAborter.abort();
usersAborter.abort();
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "saborter",
"version": "2.3.0",
"version": "2.4.0",
"description": "A simple and efficient library for canceling asynchronous requests using AbortController",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Expand Down
48 changes: 16 additions & 32 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ yarn add saborter

## 📈 Why Saborter ?

**Saborter** is an ecosystem that provides the user with the ability to use both full-fledged modules (such as `Aborter` and `ReusableAborter`) and individual components: lib functions, error classes, and polyfills.

### Why is this necessary?

We constantly encounter situations where an incipient request needs to be canceled: the user quickly types in search, switches tabs, or a component unmounts. The native `AbortController` allows this, but its use in real-world scenarios results in boilerplate code, error handling issues, and awkward `finally` blocks.
Expand Down Expand Up @@ -177,7 +179,7 @@ const results = await aborter.try(async () => {
});

// Axios
const results = await aborter.try(() => axios.get('/api/users').data);
const results = await aborter.try(() => axios.get('/api/users').then((res) => res.data));
```

### 4. Built-in debounce functionality
Expand Down Expand Up @@ -778,51 +780,33 @@ const result = await aborter.try(async () => {
```typescript
import axios from 'axios';

try {
const users = await aborter.try(async () => {
const response = await axios.get<User[]>('/api/users');
return response.data;
});
} catch (error) {
if (error instanceof AbortError) {
console.log('Aborted!');
}
}
const users = await aborter.try(async () => {
const response = await axios.get<User[]>('/api/users');
return response.data;
});
```

**Wretch:**

```typescript
import wretch from 'wretch';

try {
const users = await aborter.try(async () => {
const users = await wretch('/api').get('/users').json<User[]>();
return users;
});
} catch (error) {
if (error instanceof AbortError) {
console.log('Aborted!');
}
}
const users = await aborter.try(async () => {
const users = await wretch('/api').get('/users').json<User[]>();
return users;
});
```

**Ky:**

```typescript
import ky from 'ky';

try {
const users = await aborter.try(() => {
return ky('/api/users', {
retry: { shouldRetry: () => false }
}).json<User[]>();
});
} catch (error) {
if (error instanceof AbortError) {
console.log('Aborted!');
}
}
const users = await aborter.try(() => {
return ky('/api/users', {
retry: { shouldRetry: () => false }
}).json<User[]>();
});
```

### Resource Cleanup
Expand Down
Binary file added unreleased-packages/saborter-2.4.0.tgz
Binary file not shown.
Loading