larasopp 1.2.25 → 1.2.27

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/lib/Core.js CHANGED
@@ -188,6 +188,7 @@ class Core {
188
188
  const json = this.jsonParse(e.data);
189
189
  if (json.socket_id) {
190
190
  this._socketId = json.socket_id;
191
+ this.events.emit('ready', true);
191
192
  return;
192
193
  }
193
194
  this.emitListener(json.channel, json.message);
@@ -1,2 +1,2 @@
1
- export declare const SocketEvents: readonly ["open", "close", "error"];
1
+ export declare const SocketEvents: readonly ["open", "close", "error", "ready"];
2
2
  export declare const ListenerEvents: readonly ["subscribe", "unsubscribe"];
package/lib/constants.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ListenerEvents = exports.SocketEvents = void 0;
4
- exports.SocketEvents = ['open', 'close', 'error'];
4
+ exports.SocketEvents = ['open', 'close', 'error', 'ready'];
5
5
  exports.ListenerEvents = ['subscribe', 'unsubscribe'];
package/lib/index.js CHANGED
@@ -19,7 +19,7 @@ class Larasopp extends Core_1.default {
19
19
  this.listenResumeSubscribes();
20
20
  }
21
21
  listenResumeSubscribes() {
22
- this.addListener('open', () => {
22
+ this.addListener('ready', () => {
23
23
  Object.keys(this.channels).forEach((channel) => this.send({
24
24
  subscribe: channel
25
25
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larasopp",
3
- "version": "1.2.25",
3
+ "version": "1.2.27",
4
4
  "description": "Websocket client for laravel",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",