@eleven-am/pondsocket 0.1.26 → 0.1.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/client/channel.js CHANGED
@@ -50,7 +50,7 @@ class Channel {
50
50
  * @param event - The event to monitor.
51
51
  * @param callback - The callback to call when a message is received.
52
52
  */
53
- onMessage(event, callback) {
53
+ onMessageEvent(event, callback) {
54
54
  return this._receiver.subscribe((data) => {
55
55
  if (data.action === enums_1.ServerActions.BROADCAST && data.event === event && data.channelName === this._name) {
56
56
  return callback(data.payload);
@@ -61,7 +61,7 @@ class Channel {
61
61
  * @desc Monitors the channel for messages.
62
62
  * @param callback - The callback to call when a message is received.
63
63
  */
64
- onMessageEvent(callback) {
64
+ onMessage(callback) {
65
65
  return this._receiver.subscribe((data) => {
66
66
  if (data.action === enums_1.ServerActions.BROADCAST && data.channelName === this._name) {
67
67
  return callback(data.event, data.payload);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleven-am/pondsocket",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "description": "PondSocket is a fast simple socket server",
5
5
  "keywords": [
6
6
  "socket",
package/types.d.ts CHANGED
@@ -129,13 +129,13 @@ export declare class Channel {
129
129
  * @param event - The event to monitor.
130
130
  * @param callback - The callback to call when a message is received.
131
131
  */
132
- public onMessage(event: string, callback: (message: PondMessage) => void): Unsubscribe;
132
+ public onMessageEvent(event: string, callback: (message: PondMessage) => void): Unsubscribe;
133
133
 
134
134
  /**
135
135
  * @desc Monitors the channel for messages.
136
136
  * @param callback - The callback to call when a message is received.
137
137
  */
138
- public onMessageEvent(callback: (event: string, message: PondMessage) => void): Unsubscribe;
138
+ public onMessage(callback: (event: string, message: PondMessage) => void): Unsubscribe;
139
139
 
140
140
  /**
141
141
  * @desc Monitors the connection state of the channel.
@@ -538,3 +538,4 @@ declare class PondSocket {
538
538
  * @constructor
539
539
  */
540
540
  declare const PondSocketFromExpress: (app: Express) => PondSocketExpressApp;
541
+