14 * It fixes a potential memory leak where the redis client would keep creating new subscriptions to the same channel.
15 * @see https://github.com/homarr-labs/homarr/issues/744
16 */
17export class ChannelSubscriptionTracker {18 private static subscriptions = new Map<string, Map<string, SubscriptionCallback>>();
19 private static redis = createRedisConnection();
20 private static listenerActive = false;
14 * It fixes a potential memory leak where the redis client would keep creating new subscriptions to the same channel.
15 * @see https://github.com/homarr-labs/homarr/issues/744
16 */
17export class ChannelSubscriptionTracker {18 private static subscriptions = new Map<string, Map<string, SubscriptionCallback>>();
19 private static redis = createRedisConnection();
20 private static listenerActive = false;
14 * It fixes a potential memory leak where the redis client would keep creating new subscriptions to the same channel.
15 * @see https://github.com/homarr-labs/homarr/issues/744
16 */
17export class ChannelSubscriptionTracker {18 private static subscriptions = new Map<string, Map<string, SubscriptionCallback>>();
19 private static redis = createRedisConnection();
20 private static listenerActive = false;
14 * It fixes a potential memory leak where the redis client would keep creating new subscriptions to the same channel.
15 * @see https://github.com/homarr-labs/homarr/issues/744
16 */
17export class ChannelSubscriptionTracker {18 private static subscriptions = new Map<string, Map<string, SubscriptionCallback>>();
19 private static redis = createRedisConnection();
20 private static listenerActive = false;
14 * It fixes a potential memory leak where the redis client would keep creating new subscriptions to the same channel.
15 * @see https://github.com/homarr-labs/homarr/issues/744
16 */
17export class ChannelSubscriptionTracker {18 private static subscriptions = new Map<string, Map<string, SubscriptionCallback>>();
19 private static redis = createRedisConnection();
20 private static listenerActive = false;
Using class as a namespace can lead to errors.
class EmptyClass {}
class ConstructorOnly {
constructor() {
foo();
}
}
// Use an object instead:
class StaticOnly {
static version = 42;
static hello() {
console.log('Hello, world!');
}
}
class EmptyClass extends SuperClass {}
class ParameterProperties {
constructor(public name: string) {}
}
const StaticOnly = {
version: 42,
hello() {
console.log('Hello, world!');
},
};