Skip to content

Commit

Permalink
getSubscribedChannels and channelGroups binding when eventEngine is e…
Browse files Browse the repository at this point in the history
…nabled
  • Loading branch information
mohitpubnub committed Jan 15, 2024
1 parent a428e1e commit d5e88d7
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 2 deletions.
8 changes: 8 additions & 0 deletions dist/web/pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -7775,6 +7775,12 @@
this.dependencies.leaveAll();
}
};
EventEngine.prototype.getSubscribedChannels = function () {
return this.channels.slice(0);
};
EventEngine.prototype.getSubscribedChannelGroups = function () {
return this.groups.slice(0);
};
EventEngine.prototype.dispose = function () {
this.disconnect();
this._unsubscribeEngine();
Expand Down Expand Up @@ -8531,6 +8537,8 @@
this.reconnect = eventEngine.reconnect.bind(eventEngine);
this.disconnect = eventEngine.disconnect.bind(eventEngine);
this.destroy = eventEngine.dispose.bind(eventEngine);
this.getSubscribedChannels = eventEngine.getSubscribedChannels.bind(eventEngine);
this.getSubscribedChannelGroups = eventEngine.getSubscribedChannelGroups.bind(eventEngine);
this.eventEngine = eventEngine;
}
else {
Expand Down
4 changes: 2 additions & 2 deletions dist/web/pubnub.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions lib/core/pubnub-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ var default_1 = /** @class */ (function () {
this.reconnect = eventEngine.reconnect.bind(eventEngine);
this.disconnect = eventEngine.disconnect.bind(eventEngine);
this.destroy = eventEngine.dispose.bind(eventEngine);
this.getSubscribedChannels = eventEngine.getSubscribedChannels.bind(eventEngine);
this.getSubscribedChannelGroups = eventEngine.getSubscribedChannelGroups.bind(eventEngine);
this.eventEngine = eventEngine;
}
else {
Expand Down
6 changes: 6 additions & 0 deletions lib/event-engine/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ var EventEngine = /** @class */ (function () {
this.dependencies.leaveAll();
}
};
EventEngine.prototype.getSubscribedChannels = function () {
return this.channels.slice(0);
};
EventEngine.prototype.getSubscribedChannelGroups = function () {
return this.groups.slice(0);
};
EventEngine.prototype.dispose = function () {
this.disconnect();
this._unsubscribeEngine();
Expand Down
2 changes: 2 additions & 0 deletions src/core/pubnub-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ export default class {
this.reconnect = eventEngine.reconnect.bind(eventEngine);
this.disconnect = eventEngine.disconnect.bind(eventEngine);
this.destroy = eventEngine.dispose.bind(eventEngine);
this.getSubscribedChannels = eventEngine.getSubscribedChannels.bind(eventEngine);
this.getSubscribedChannelGroups = eventEngine.getSubscribedChannelGroups.bind(eventEngine);
this.eventEngine = eventEngine;
} else {
const subscriptionManager = new SubscriptionManager({
Expand Down
8 changes: 8 additions & 0 deletions src/event-engine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ export class EventEngine {
}
}

getSubscribedChannels() {
return this.channels.slice(0);
}

getSubscribedChannelGroups() {
return this.groups.slice(0);
}

dispose() {
this.disconnect();
this._unsubscribeEngine();
Expand Down

0 comments on commit d5e88d7

Please sign in to comment.