prostgles-client 4.0.98 → 4.0.100

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/prostgles.js CHANGED
@@ -53,11 +53,11 @@ const useProstglesClient = ({ skip, socketOptions, ...initOpts } = {}) => {
53
53
  socket.current = typeof (socketOptions === null || socketOptions === void 0 ? void 0 : socketOptions.uri) === "string" ? io(socketOptions.uri, opts) : io(opts);
54
54
  }, [socketOptions === null || socketOptions === void 0 ? void 0 : socketOptions.path]);
55
55
  (0, react_hooks_1.useAsyncEffectQueue)(async () => {
56
- if (!socket || skip)
56
+ if (!socket.current || skip)
57
57
  return;
58
58
  //@ts-ignore
59
59
  const prgl = await prostgles({
60
- socket,
60
+ socket: socket.current,
61
61
  ...initOpts,
62
62
  onReady: (...args) => {
63
63
  if (!getIsMounted())
@@ -20,9 +20,8 @@ exports.getReact = getReact;
20
20
  (0, exports.getReact)();
21
21
  const { useEffect = alertNoReact, useCallback = alertNoReact, useRef, useState = alertNoReactT } = (_a = React) !== null && _a !== void 0 ? _a : {};
22
22
  const getIO = (throwError = false) => {
23
- var _a;
24
23
  try {
25
- const io = (_a = require("socket.io-client")) === null || _a === void 0 ? void 0 : _a.default;
24
+ const io = require("socket.io-client");
26
25
  return io;
27
26
  }
28
27
  catch (err) {
package/lib/prostgles.ts CHANGED
@@ -92,11 +92,11 @@ export const useProstglesClient = <DBSchema>({ skip, socketOptions, ...initOpts
92
92
  }, [socketOptions?.path]);
93
93
 
94
94
  useAsyncEffectQueue(async () => {
95
- if(!socket || skip) return;
95
+ if(!socket.current || skip) return;
96
96
 
97
97
  //@ts-ignore
98
98
  const prgl = await prostgles({
99
- socket,
99
+ socket: socket.current,
100
100
  ...initOpts,
101
101
  onReady: (...args) => {
102
102
  if (!getIsMounted()) return;
@@ -19,7 +19,7 @@ const { useEffect = alertNoReact, useCallback = alertNoReact, useRef, useState =
19
19
  type IO = typeof import("socket.io-client").default;
20
20
  export const getIO = (throwError = false) => {
21
21
  try {
22
- const io = require("socket.io-client")?.default as IO;
22
+ const io = require("socket.io-client") as IO;
23
23
  return io;
24
24
  } catch(err){
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prostgles-client",
3
- "version": "4.0.98",
3
+ "version": "4.0.100",
4
4
  "description": "Reactive client for Postgres",
5
5
  "main": "dist/prostgles-full.js",
6
6
  "types": "dist/prostgles-full.d.ts",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "..": {
19
19
  "name": "prostgles-client",
20
- "version": "4.0.97",
20
+ "version": "4.0.99",
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
23
  "prostgles-types": "^4.0.73"