@folklore/socket 0.4.32 → 0.4.33

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -770,7 +770,7 @@ function SocketContainer({
770
770
  publishKey = null,
771
771
  subscribeKey = null,
772
772
  secretKey = null,
773
- channels: initialChannels = [],
773
+ channels: initialChannels,
774
774
  ...props
775
775
  }) {
776
776
  const finalSocket = useMemo(() => socket || new Socket({
@@ -813,11 +813,11 @@ function SocketContainer({
813
813
  const subscribe = useCallback(channelsToAdd => addToChannelsCount(isString(channelsToAdd) ? [channelsToAdd] : channelsToAdd), [addToChannelsCount]);
814
814
  const unsubscribe = useCallback(channelsToRemove => removeToChannelsCount(isString(channelsToRemove) ? [channelsToRemove] : channelsToRemove), [removeToChannelsCount]);
815
815
  useEffect(() => {
816
- subscribe(initialChannels);
816
+ subscribe(initialChannels || []);
817
817
  return () => {
818
- unsubscribe(initialChannels);
818
+ unsubscribe(initialChannels || []);
819
819
  };
820
- }, [initialChannels, subscribe, unsubscribe]);
820
+ }, [initialChannels || [], subscribe, unsubscribe]);
821
821
  useEffect(() => {
822
822
  finalSocket.init();
823
823
  if (autoStart) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@folklore/socket",
3
- "version": "0.4.32",
3
+ "version": "0.4.33",
4
4
  "description": "Socket utilities",
5
5
  "keywords": [
6
6
  "javascript",
@@ -64,5 +64,5 @@
64
64
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
65
65
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
66
66
  },
67
- "gitHead": "d1ea3212d18c8203657536bc2b80caeb284403e2"
67
+ "gitHead": "560661f2ec3b2be074323a5501b55ab452728168"
68
68
  }