Skip to content

Commit 654909f

Browse files
committed
fix: correct abort logic in useSSE
1 parent 627e1ef commit 654909f

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
# Changelog
44

5+
## 1.4.14
6+
7+
2025-9-10
8+
9+
### Bug Fixes
10+
11+
#### `useSSE`
12+
13+
- 🐞 Correct abort logic in useSSE.
14+
515
## 1.4.13
616

717
2025-9-8

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tiny-codes/react-easy",
3-
"version": "1.4.13",
3+
"version": "1.4.14",
44
"description": "Simplify React and AntDesign development with practical components and hooks",
55
"keywords": [
66
"react",

src/hooks/useSSE.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const useSSE = <T = any>(props: UseSSEProps<T>) => {
112112

113113
const abort = useRefFunction(() => {
114114
setIsConnected(false);
115-
if (isConnected && abortCtrlRef.current) {
115+
if (!isConnected && abortCtrlRef.current) {
116116
abortCtrlRef.current.abort();
117117
}
118118
});

0 commit comments

Comments
 (0)