Skip to content

Commit

Permalink
fix(types): improve interop with zen observable
Browse files Browse the repository at this point in the history
  • Loading branch information
forivall committed May 10, 2024
1 parent 78106a2 commit 293ff15
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/internal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ export interface Subscribable<T> {
subscribe(observer: Partial<Observer<T>>): Unsubscribable;
}

export interface InteropSubscribable<T> {
subscribe(observer: Partial<Observer<T>>): Unsubscribable;
subscribe(onNext?: (value: T) => void, onError?: (error: any) => void, onComplete?: () => void): Subscription;
}

/**
* Valid types that can be converted to observables.
*/
Expand All @@ -118,7 +123,7 @@ export type ObservableLike<T> = InteropObservable<T>;
* An object that implements the `Symbol.observable` interface.
*/
export interface InteropObservable<T> {
[Symbol.observable]: () => Subscribable<T>;
[Symbol.observable]: () => Subscribable<T> | InteropSubscribable<T>;
}

/* NOTIFICATIONS */
Expand Down

0 comments on commit 293ff15

Please sign in to comment.