socket-function 1.1.31 → 1.1.32

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.
@@ -66,7 +66,7 @@ export declare class SocketFunction {
66
66
  /** Will dedupe callbacks, so if you call with the same callback it won't call it multiple times (otherwise it's difficult to manage this, as this only calls on the NEXT callback).
67
67
  IMPORTANT! Client node ids will NEVER reconnect, so this can full cleanup. However full nodeIds might if we try to use that nodeId again, so this cannot fully clean them up.
68
68
  */
69
- static onNextDisconnect(nodeId: string, callback: () => void, noServerNodeIdWarning?: "iKnowThatServerNodeIdsMayReconnect_andDontPermanentlyCleanThemUp"): void;
69
+ static onNextDisconnect(nodeId: string, callback: () => void, noServerNodeIdWarning?: "iKnowThatServerNodeIdsMayReconnect_andIHandleReconnections"): void;
70
70
  static getLastDisconnectTime(nodeId: string): number | undefined;
71
71
  static isNodeConnected(nodeId: string): boolean;
72
72
  /** NOTE: Only works if the nodeIs used is from SocketFunction.connect (we can't convert arbitrary nodeIds into urls,
package/SocketFunction.ts CHANGED
@@ -294,7 +294,7 @@ export class SocketFunction {
294
294
  nodeId: string,
295
295
  callback: () => void,
296
296
  // NOTE: It's important to know that unlike client ids, server ids (a nodeId YOU connect to, instead of connecting to you), might be alive again, and so you need some kind of logic to try it again or in some way reconnect. For clients you don't need to, as it's their job to reconnect to you, and they will reconnect with a NEW nodeId.
297
- noServerNodeIdWarning?: "iKnowThatServerNodeIdsMayReconnect_andDontPermanentlyCleanThemUp"
297
+ noServerNodeIdWarning?: "iKnowThatServerNodeIdsMayReconnect_andIHandleReconnections"
298
298
  ) {
299
299
  if (!isClientNodeId(nodeId) && !noServerNodeIdWarning) {
300
300
  console.warn(`Watching for disconnections of ${nodeId}. This is a server nodeId and may be alive again after disconnection. Please set the noServerNodeIdWarning flag in this argument to confirm you are handling reconnecting if the server becomes available again.`);
package/index.d.ts CHANGED
@@ -75,7 +75,7 @@ declare module "socket-function/SocketFunction" {
75
75
  /** Will dedupe callbacks, so if you call with the same callback it won't call it multiple times (otherwise it's difficult to manage this, as this only calls on the NEXT callback).
76
76
  IMPORTANT! Client node ids will NEVER reconnect, so this can full cleanup. However full nodeIds might if we try to use that nodeId again, so this cannot fully clean them up.
77
77
  */
78
- static onNextDisconnect(nodeId: string, callback: () => void, noServerNodeIdWarning?: "iKnowThatServerNodeIdsMayReconnect_andDontPermanentlyCleanThemUp"): void;
78
+ static onNextDisconnect(nodeId: string, callback: () => void, noServerNodeIdWarning?: "iKnowThatServerNodeIdsMayReconnect_andIHandleReconnections"): void;
79
79
  static getLastDisconnectTime(nodeId: string): number | undefined;
80
80
  static isNodeConnected(nodeId: string): boolean;
81
81
  /** NOTE: Only works if the nodeIs used is from SocketFunction.connect (we can't convert arbitrary nodeIds into urls,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "1.1.31",
3
+ "version": "1.1.32",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {