From 3fd6dc3e0561f78072db3495e13c64e5a25c3409 Mon Sep 17 00:00:00 2001 From: yoanngueny Date: Wed, 30 Jun 2021 11:07:15 +0200 Subject: [PATCH 1/2] fix removeListener index --- src/core/Renderer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Renderer.ts b/src/core/Renderer.ts index cfd0516..397a330 100644 --- a/src/core/Renderer.ts +++ b/src/core/Renderer.ts @@ -238,7 +238,7 @@ export default defineComponent({ removeListener(type: string, cb: {(e?: any): void}) { const callbacks = this.getCallbacks(type) const index = callbacks.indexOf(cb) - if (index) callbacks.splice(index, 1) + if (index != -1) callbacks.splice(index, 1) }, getCallbacks(type: string) { From d4eafa68246f880d99771bb87c80b9452f8fb091 Mon Sep 17 00:00:00 2001 From: yoanngueny Date: Fri, 2 Jul 2021 09:16:29 +0200 Subject: [PATCH 2/2] fix removeListener esLint --- src/core/Renderer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Renderer.ts b/src/core/Renderer.ts index 397a330..0597bbc 100644 --- a/src/core/Renderer.ts +++ b/src/core/Renderer.ts @@ -238,7 +238,7 @@ export default defineComponent({ removeListener(type: string, cb: {(e?: any): void}) { const callbacks = this.getCallbacks(type) const index = callbacks.indexOf(cb) - if (index != -1) callbacks.splice(index, 1) + if (index !== -1) callbacks.splice(index, 1) }, getCallbacks(type: string) {