File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ const options: EventSourceOptions = {
149
149
150
150
## 🚀 Advanced usage with TypeScript
151
151
152
- Using EventSource you can handle custom events invoked by server:
152
+ Using EventSource you can handle custom events invoked by the server:
153
153
154
154
``` typescript
155
155
import EventSource from " react-native-sse" ;
@@ -188,7 +188,7 @@ export interface CustomEvent<E extends string> {
188
188
189
189
## 👏 Contribution
190
190
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.
192
192
193
193
## 📄 License
194
194
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ export interface CloseEvent {
19
19
type : 'close' ;
20
20
}
21
21
22
+ export interface TimeoutEvent {
23
+ type : 'timeout' ;
24
+ }
25
+
22
26
export interface ErrorEvent {
23
27
type : 'error' ;
24
28
message : string ;
@@ -46,7 +50,7 @@ export interface EventSourceOptions {
46
50
pollingInterval ?: number ;
47
51
}
48
52
49
- export type EventSourceEvent = MessageEvent | OpenEvent | CloseEvent | ErrorEvent | ExceptionEvent ;
53
+ export type EventSourceEvent = MessageEvent | OpenEvent | CloseEvent | TimeoutEvent | ErrorEvent | ExceptionEvent ;
50
54
51
55
export type EventSourceListener < E extends string = never > = (
52
56
event : CustomEvent < E > | EventSourceEvent
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-native-sse" ,
3
- "version" : " 1.0.2 " ,
3
+ "version" : " 1.0.3 " ,
4
4
"description" : " EventSource implementation for React Native. Server-Sent Events (SSE) for iOS and Android." ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments