From 3bc7a4ecb7e2150ce77150cddb076604b0add235 Mon Sep 17 00:00:00 2001 From: raveclassic Date: Wed, 25 Jan 2023 16:33:09 +0300 Subject: [PATCH 1/3] chore: update rxjs version in lockfile --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 02cbdfd928..e301f67a10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rxjs", - "version": "7.6.0", + "version": "7.8.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "rxjs", - "version": "7.6.0", + "version": "7.8.0", "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" From ba2b0b1d18417ab47f4b47880f769079c59fa39b Mon Sep 17 00:00:00 2001 From: raveclassic Date: Wed, 25 Jan 2023 17:00:28 +0300 Subject: [PATCH 2/3] fix(subscriber): strict Subscriber.next type signature BREAKING CHANGE: Subscriber.next now takes strict argument --- src/internal/Subscriber.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal/Subscriber.ts b/src/internal/Subscriber.ts index e682fe402b..b65e2ba505 100644 --- a/src/internal/Subscriber.ts +++ b/src/internal/Subscriber.ts @@ -68,7 +68,7 @@ export class Subscriber extends Subscription implements Observer { * @param {T} [value] The `next` value. * @return {void} */ - next(value?: T): void { + next(value: T): void { if (this.isStopped) { handleStoppedNotification(nextNotification(value), this); } else { @@ -203,7 +203,7 @@ export class SafeSubscriber extends Subscriber { // The first argument is a function, not an observer. The next // two arguments *could* be observers, or they could be empty. partialObserver = { - next: (observerOrNext ?? undefined) as (((value: T) => void) | undefined), + next: (observerOrNext ?? undefined) as ((value: T) => void) | undefined, error: error ?? undefined, complete: complete ?? undefined, }; From de7598b88fc0a3a527f14d471628d73fc3ccb1d8 Mon Sep 17 00:00:00 2001 From: raveclassic Date: Tue, 31 Jan 2023 13:01:17 +0300 Subject: [PATCH 3/3] test(subscriber): add explicit Subscriber annotation --- spec/Subscriber-spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/Subscriber-spec.ts b/spec/Subscriber-spec.ts index be229f1ea5..a5a0cc03b7 100644 --- a/spec/Subscriber-spec.ts +++ b/spec/Subscriber-spec.ts @@ -9,7 +9,7 @@ describe('SafeSubscriber', () => { it('should ignore next messages after unsubscription', () => { let times = 0; - const sub = new SafeSubscriber({ + const sub = new SafeSubscriber({ next() { times += 1; } }); @@ -25,7 +25,7 @@ describe('SafeSubscriber', () => { let times = 0; let errorCalled = false; - const sub = new SafeSubscriber({ + const sub = new SafeSubscriber({ next() { times += 1; }, error() { errorCalled = true; } }); @@ -44,7 +44,7 @@ describe('SafeSubscriber', () => { let times = 0; let completeCalled = false; - const sub = new SafeSubscriber({ + const sub = new SafeSubscriber({ next() { times += 1; }, complete() { completeCalled = true; } }); @@ -268,4 +268,4 @@ describe('Subscriber', () => { } else { console.warn(`No support for FinalizationRegistry in Node ${process.version}`); } -}); \ No newline at end of file +});