Skip to content

Commit

Permalink
Use Subscription type instead of Subscribable
Browse files Browse the repository at this point in the history
We claim compatibility with RxJS version 5 but in V5 the type Subscribable does not exist. This does not lead to an issue as the unsubscribe() method exists in Subscribable (V6+) and ISubscription (V5) but it is not very clean.
  • Loading branch information
guidoderooij authored Mar 25, 2024
1 parent 355919f commit 781ff98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/sherlock-rxjs/rxjs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { _internal, atom, Derivable, ErrorWrapper, ReactorOptions } from '@politie/sherlock';
import { Observable, Subscriber, Unsubscribable } from 'rxjs';
import { Observable, Subscriber, Subscription } from 'rxjs';

/**
* Creates an RxJS Observable from a Derivable. Optionally accepts a `ReactorOptions` that governs RxJS emissions
Expand All @@ -20,7 +20,7 @@ export function toObservable<V>(derivable: Derivable<V>, options?: Partial<React
export function fromObservable<V>(observable: Observable<V>): Derivable<V> {
const atom$ = atom.unresolved<V>();

let subscription: Unsubscribable | undefined;
let subscription: Subscription | undefined;
atom$.connected$.react(() => {
if (atom$.connected && !subscription) {
subscription = observable.subscribe({
Expand Down

0 comments on commit 781ff98

Please sign in to comment.