Skip to content

Commit

Permalink
fix: ts overload
Browse files Browse the repository at this point in the history
  • Loading branch information
nia3y authored Jan 21, 2021
1 parent d22635d commit 66a6b42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/Container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ export class Container<T> {

public unsubscribe(type: 'state', payload: StateSubscriber<T>): void
public unsubscribe(type: 'effect', payload: EffectSubscriber): void
public unsubscribe(type: SubscribeType, payload: StateSubscriber<T> | EffectSubscriber): void {
public unsubscribe(type: any, payload: any): void {
if (type === 'state') {
const index = this.stateSubscribers.indexOf(payload as StateSubscriber<T>)
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)
}
}
Expand Down

0 comments on commit 66a6b42

Please sign in to comment.