From 66a6b42f753e4e81dc6579ca7053a2d1ee21f1a8 Mon Sep 17 00:00:00 2001 From: niayyy Date: Thu, 21 Jan 2021 16:33:31 +0800 Subject: [PATCH] fix: ts overload --- src/core/Container.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/Container.ts b/src/core/Container.ts index 54f89e7..3898211 100644 --- a/src/core/Container.ts +++ b/src/core/Container.ts @@ -49,12 +49,12 @@ export class Container { public unsubscribe(type: 'state', payload: StateSubscriber): void public unsubscribe(type: 'effect', payload: EffectSubscriber): void - public unsubscribe(type: SubscribeType, payload: StateSubscriber | EffectSubscriber): void { + public unsubscribe(type: any, payload: any): void { if (type === 'state') { - const index = this.stateSubscribers.indexOf(payload as StateSubscriber) + const index = this.stateSubscribers.indexOf(payload) this.stateSubscribers.splice(index, 1) } /* istanbul ignore else */ else if (type === 'effect') { - const index = this.effectSubscribers.indexOf(payload as EffectSubscriber) + const index = this.effectSubscribers.indexOf(payload) this.effectSubscribers.splice(index, 1) } }