From c85e0b57a1ff7188cc477de6acdfe3b5456e309a Mon Sep 17 00:00:00 2001 From: Yusinto Ngadiman Date: Mon, 27 Nov 2023 12:47:36 -0800 Subject: [PATCH] Update EventSource.ts --- .../src/polyfills/react-native-sse/EventSource.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/sdk/react-native/src/polyfills/react-native-sse/EventSource.ts b/packages/sdk/react-native/src/polyfills/react-native-sse/EventSource.ts index 796027f84..420c5fdad 100644 --- a/packages/sdk/react-native/src/polyfills/react-native-sse/EventSource.ts +++ b/packages/sdk/react-native/src/polyfills/react-native-sse/EventSource.ts @@ -1,5 +1,10 @@ /** * Ripped from https://github.com/binaryminds/react-native-sse + * These changes are made from the above repo at fork-time: + * 1. converted to ts and fix ts related errors. + * 2. added onopen, onclose, onerror, onretrying functions. + * 3. modified dispatch to work with functions added in 2. + * 4. replaced all for of loops with foreach */ import type { EventSourceEvent, EventSourceListener, EventSourceOptions, EventType } from './types';