From 781ff98d03f8ee884d689048a483d4f1e8dd574a Mon Sep 17 00:00:00 2001 From: Guido de Rooij <72734809+guidoderooij@users.noreply.github.com> Date: Mon, 25 Mar 2024 14:51:39 +0100 Subject: [PATCH] Use Subscription type instead of Subscribable 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. --- extensions/sherlock-rxjs/rxjs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/sherlock-rxjs/rxjs.ts b/extensions/sherlock-rxjs/rxjs.ts index 2144b55..5d77e96 100644 --- a/extensions/sherlock-rxjs/rxjs.ts +++ b/extensions/sherlock-rxjs/rxjs.ts @@ -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 @@ -20,7 +20,7 @@ export function toObservable(derivable: Derivable, options?: Partial(observable: Observable): Derivable { const atom$ = atom.unresolved(); - let subscription: Unsubscribable | undefined; + let subscription: Subscription | undefined; atom$.connected$.react(() => { if (atom$.connected && !subscription) { subscription = observable.subscribe({