@ecodrix/erix-api 1.0.5 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecodrix/erix-api",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "author": "ECODrIx Team <contact@ecodrix.com>",
5
5
  "license": "MIT",
6
6
  "description": "Official Isomorphic SDK for the ECODrIx platform. Native support for WhatsApp, CRM, Storage, and Meetings across TS, JS, Python, and Java.",
package/src/core.ts CHANGED
@@ -236,6 +236,20 @@ export class Ecodrix {
236
236
  this.socket.disconnect();
237
237
  }
238
238
 
239
+ /**
240
+ * Remove a previously registered event listener.
241
+ * Always call this in cleanup (e.g. React `useEffect` return) to prevent
242
+ * memory leaks and duplicate handlers after reconnections.
243
+ *
244
+ * @param event - The event name to unsubscribe from.
245
+ * @param callback - The exact handler reference passed to `.on()`.
246
+ * @returns `this` for method chaining.
247
+ */
248
+ public off(event: string, callback: (...args: any[]) => void): this {
249
+ this.socket.off(event, callback);
250
+ return this;
251
+ }
252
+
239
253
  /**
240
254
  * Raw Execution Escape-Hatch.
241
255
  * Send an authenticated HTTP request directly to the ECODrIx backend from ANY external project.