Comparing version 2.0.4-channel-groups to 2.0.5-channel-groups
{ | ||
"name": "ably", | ||
"description": "Realtime client library for Ably, the realtime messaging service", | ||
"version": "2.0.4-channel-groups", | ||
"version": "2.0.5-channel-groups", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -15,3 +15,3 @@ import * as Ably from 'ably'; | ||
export type ChannelParameters = string | ChannelNameAndOptions; | ||
export declare const version = "2.0.4-channel-groups"; | ||
export declare const version = "2.0.5-channel-groups"; | ||
export declare function channelOptionsWithAgent(options?: Ably.ChannelOptions): { | ||
@@ -18,0 +18,0 @@ params: { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.channelOptionsWithAgent = exports.version = void 0; | ||
exports.version = '2.0.4-channel-groups'; | ||
exports.version = '2.0.5-channel-groups'; | ||
function channelOptionsWithAgent(options) { | ||
@@ -6,0 +6,0 @@ return Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.params), { agent: `react-hooks/${exports.version}` }) }); |
@@ -15,3 +15,3 @@ import * as Ably from 'ably'; | ||
export type ChannelParameters = string | ChannelNameAndOptions; | ||
export declare const version = "2.0.4-channel-groups"; | ||
export declare const version = "2.0.5-channel-groups"; | ||
export declare function channelOptionsWithAgent(options?: Ably.ChannelOptions): { | ||
@@ -18,0 +18,0 @@ params: { |
@@ -1,2 +0,2 @@ | ||
export const version = '2.0.4-channel-groups'; | ||
export const version = '2.0.5-channel-groups'; | ||
export function channelOptionsWithAgent(options) { | ||
@@ -3,0 +3,0 @@ return Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.params), { agent: `react-hooks/${version}` }) }); |
@@ -272,3 +272,11 @@ import * as Utils from '../util/utils'; | ||
await this.active.subscribe((msg: any) => { | ||
this.activeChannels = msg.data.active; | ||
if (!msg.data || !msg.data.active || !Array.isArray(msg.data.active)) { | ||
return; | ||
} | ||
const newActive = msg.data.active.filter((x: string) => this.expression.test(x)); | ||
newActive.sort(); | ||
if (Utils.arrEquals(newActive, this.activeChannels)) { | ||
return; | ||
} | ||
this.activeChannels = newActive; | ||
this.emit('active.updated', this.activeChannels); | ||
@@ -284,3 +292,5 @@ this.updateAssignedChannels(); | ||
this.assignedChannels = []; | ||
this.activeChannels = []; | ||
this.emit('assigned.updated', this.assignedChannels); | ||
this.emit('active.updated', this.activeChannels); | ||
this.removeSubscriptions(Object.keys(this.subscribedChannels)); | ||
@@ -301,5 +311,3 @@ } | ||
const matched = this.activeChannels | ||
.filter((x) => this.expression.test(x)) | ||
.filter((x) => this.consumerGroup.assigned(x)); | ||
const matched = this.activeChannels.filter((channel) => this.consumerGroup.assigned(channel)); | ||
@@ -306,0 +314,0 @@ const { add, remove } = diffSets(this.assignedChannels, matched); |
@@ -19,3 +19,3 @@ import * as Ably from 'ably'; | ||
export const version = '2.0.4-channel-groups'; | ||
export const version = '2.0.5-channel-groups'; | ||
@@ -22,0 +22,0 @@ export function channelOptionsWithAgent(options?: Ably.ChannelOptions) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
5649947
70898