react-realtime-hooks 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -940,8 +940,9 @@ var useWebSocket = (options) => {
|
|
|
940
940
|
const nextSocketEpochRef = useRef(0);
|
|
941
941
|
const controller = useWebSocketController();
|
|
942
942
|
const [openNonce, setOpenNonce] = useState(0);
|
|
943
|
+
const initialStatus = !supported || resolvedUrl === null ? "closed" : connect ? "connecting" : "idle";
|
|
943
944
|
const [state, setState] = useState(
|
|
944
|
-
() => createInitialState4(
|
|
945
|
+
() => createInitialState4(initialStatus)
|
|
945
946
|
);
|
|
946
947
|
const stateRef = useRef(state);
|
|
947
948
|
useInsertionEffect(() => {
|
|
@@ -1515,8 +1516,9 @@ var useEventSource = (options) => {
|
|
|
1515
1516
|
const suppressReconnectRef = useRef(false);
|
|
1516
1517
|
const terminalErrorRef = useRef(null);
|
|
1517
1518
|
const [openNonce, setOpenNonce] = useState(0);
|
|
1519
|
+
const initialStatus = !supported || resolvedUrl === null ? "closed" : connect ? "connecting" : "idle";
|
|
1518
1520
|
const [state, setState] = useState(
|
|
1519
|
-
() => createInitialState5(
|
|
1521
|
+
() => createInitialState5(initialStatus)
|
|
1520
1522
|
);
|
|
1521
1523
|
const stateRef = useRef(state);
|
|
1522
1524
|
useInsertionEffect(() => {
|