multichat-ts 0.0.86 → 0.0.87

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.
@@ -74,21 +74,29 @@ export class KickPusher {
74
74
  this.socket.connection.bind('state_change', (state) => {
75
75
  switch (state.current) {
76
76
  case 'connected': {
77
+ this.isConnected = true;
77
78
  console.log(`Connected to Kick Pusher (${this.channel_name})!`);
78
79
  break;
79
80
  }
80
81
  case 'connecting': {
82
+ this.isConnected = false;
81
83
  console.log(`Connecting to Kick Pusher (${this.channel_name})...`);
82
84
  break;
83
85
  }
84
86
  case 'failed': {
87
+ this.isConnected = false;
85
88
  console.log(`Failed to connect to Kick Pusher (${this.channel_name})`);
86
89
  break;
87
90
  }
88
91
  case 'unavailable': {
92
+ this.isConnected = false;
89
93
  console.log(`Disconnected from Kick Pusher (${this.channel_name})`);
90
94
  break;
91
95
  }
96
+ default: {
97
+ this.isConnected = false;
98
+ break;
99
+ }
92
100
  }
93
101
  this.public_listeners.connection_state_changed?.(state);
94
102
  });
@@ -74,21 +74,29 @@ export class KickPusher {
74
74
  this.socket.connection.bind('state_change', (state) => {
75
75
  switch (state.current) {
76
76
  case 'connected': {
77
+ this.isConnected = true;
77
78
  console.log(`Connected to Kick Pusher (${this.channel_name})!`);
78
79
  break;
79
80
  }
80
81
  case 'connecting': {
82
+ this.isConnected = false;
81
83
  console.log(`Connecting to Kick Pusher (${this.channel_name})...`);
82
84
  break;
83
85
  }
84
86
  case 'failed': {
87
+ this.isConnected = false;
85
88
  console.log(`Failed to connect to Kick Pusher (${this.channel_name})`);
86
89
  break;
87
90
  }
88
91
  case 'unavailable': {
92
+ this.isConnected = false;
89
93
  console.log(`Disconnected from Kick Pusher (${this.channel_name})`);
90
94
  break;
91
95
  }
96
+ default: {
97
+ this.isConnected = false;
98
+ break;
99
+ }
92
100
  }
93
101
  this.public_listeners.connection_state_changed?.(state);
94
102
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multichat-ts",
3
- "version": "0.0.86",
3
+ "version": "0.0.87",
4
4
  "type": "module",
5
5
  "description": "Receive type-safe realtime events for chat-related messages on multiple platforms (Twitch, Kick)",
6
6
  "repository": {
@@ -137,21 +137,29 @@ export class KickPusher {
137
137
  this.socket.connection.bind('state_change', (state: ConnectionStateEvent) => {
138
138
  switch (state.current) {
139
139
  case 'connected': {
140
+ this.isConnected = true;
140
141
  console.log(`Connected to Kick Pusher (${this.channel_name})!`);
141
142
  break;
142
143
  }
143
144
  case 'connecting': {
145
+ this.isConnected = false;
144
146
  console.log(`Connecting to Kick Pusher (${this.channel_name})...`);
145
147
  break;
146
148
  }
147
149
  case 'failed': {
150
+ this.isConnected = false;
148
151
  console.log(`Failed to connect to Kick Pusher (${this.channel_name})`);
149
152
  break;
150
153
  }
151
154
  case 'unavailable': {
155
+ this.isConnected = false;
152
156
  console.log(`Disconnected from Kick Pusher (${this.channel_name})`);
153
157
  break;
154
158
  }
159
+ default: {
160
+ this.isConnected = false;
161
+ break;
162
+ }
155
163
  }
156
164
  this.public_listeners.connection_state_changed?.(state);
157
165
  });
@@ -137,21 +137,29 @@ export class KickPusher {
137
137
  this.socket.connection.bind('state_change', (state: ConnectionStateEvent) => {
138
138
  switch (state.current) {
139
139
  case 'connected': {
140
+ this.isConnected = true;
140
141
  console.log(`Connected to Kick Pusher (${this.channel_name})!`);
141
142
  break;
142
143
  }
143
144
  case 'connecting': {
145
+ this.isConnected = false;
144
146
  console.log(`Connecting to Kick Pusher (${this.channel_name})...`);
145
147
  break;
146
148
  }
147
149
  case 'failed': {
150
+ this.isConnected = false;
148
151
  console.log(`Failed to connect to Kick Pusher (${this.channel_name})`);
149
152
  break;
150
153
  }
151
154
  case 'unavailable': {
155
+ this.isConnected = false;
152
156
  console.log(`Disconnected from Kick Pusher (${this.channel_name})`);
153
157
  break;
154
158
  }
159
+ default: {
160
+ this.isConnected = false;
161
+ break;
162
+ }
155
163
  }
156
164
  this.public_listeners.connection_state_changed?.(state);
157
165
  });