From 6500c98922a1a5abacf33c412d93233aabdcfbfa Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 19 Aug 2024 19:59:21 +0900 Subject: [PATCH] refactor(query-core): shorten listeners code (#7913) --- packages/query-core/src/subscribable.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/query-core/src/subscribable.ts b/packages/query-core/src/subscribable.ts index e83e1f8cec..044efe6472 100644 --- a/packages/query-core/src/subscribable.ts +++ b/packages/query-core/src/subscribable.ts @@ -1,10 +1,7 @@ -type Listener = () => void - -export class Subscribable { - protected listeners: Set +export class Subscribable { + protected listeners = new Set() constructor() { - this.listeners = new Set() this.subscribe = this.subscribe.bind(this) }