Skip to content

Commit 2aa6ce0

Browse files
committed
Add TimeoutEvent interface. Update README.
1 parent 1163230 commit 2aa6ce0

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const options: EventSourceOptions = {
149149

150150
## 🚀 Advanced usage with TypeScript
151151

152-
Using EventSource you can handle custom events invoked by server:
152+
Using EventSource you can handle custom events invoked by the server:
153153

154154
```typescript
155155
import EventSource from "react-native-sse";
@@ -188,7 +188,7 @@ export interface CustomEvent<E extends string> {
188188

189189
## 👏 Contribution
190190

191-
If you see our library is not working properly, feel free to open issue or create pull request with your fixes.
191+
If you see our library is not working properly, feel free to open an issue or create a pull request with your fixes.
192192

193193
## 📄 License
194194

index.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export interface CloseEvent {
1919
type: 'close';
2020
}
2121

22+
export interface TimeoutEvent {
23+
type: 'timeout';
24+
}
25+
2226
export interface ErrorEvent {
2327
type: 'error';
2428
message: string;
@@ -46,7 +50,7 @@ export interface EventSourceOptions {
4650
pollingInterval?: number;
4751
}
4852

49-
export type EventSourceEvent = MessageEvent | OpenEvent | CloseEvent | ErrorEvent | ExceptionEvent;
53+
export type EventSourceEvent = MessageEvent | OpenEvent | CloseEvent | TimeoutEvent | ErrorEvent | ExceptionEvent;
5054

5155
export type EventSourceListener<E extends string = never> = (
5256
event: CustomEvent<E> | EventSourceEvent

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-sse",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "EventSource implementation for React Native. Server-Sent Events (SSE) for iOS and Android.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)