Skip to content

Commit 0d1fccc

Browse files
committed
Update README.md, fix constructor interface.
1 parent e3c5880 commit 0d1fccc

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Your missing EventSource implementation for React Native! React-Native-SSE library supports TypeScript.
44

5-
## 🪄 Installation
5+
## 💿 Installation
66

77
We use XMLHttpRequest to establish and handle an SSE connection, so you don't need an additional native Android and iOS implementation. It's easy, just install it with your favorite package manager:
88

@@ -18,7 +18,7 @@ yarn add react-native-sse
1818
npm install --save react-native-sse
1919
```
2020

21-
## 🎉 Usage
21+
## 🎉 Usage
2222

2323
We are using Server-Sent Events as a convenient way of establishing and handling Mercure connections. It helps us keep data always up-to-date, synchronize data between devices, and improve real-time workflow. Here you have some usage examples:
2424

@@ -185,6 +185,8 @@ Custom events always emit result with following interface:
185185
export interface CustomEvent<E extends string> {
186186
type: E;
187187
data: string | null;
188+
lastEventId: string | null;
189+
url: string;
188190
}
189191
```
190192

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export type EventSourceListener<E extends string = never> = (
5959
) => void;
6060

6161
declare class EventSource<E extends string = never> {
62-
constructor(url: URL | string, options?: EventSourceOptions = {});
62+
constructor(url: URL | string, options?: EventSourceOptions);
6363
open(): void;
6464
close(): void;
6565
addEventListener(type: E | EventType, listener: EventSourceListener<E>): void;

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.5",
3+
"version": "1.1.0",
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)