From 1db6b9fe3b335a534037fe3d82a8985d8ac51deb Mon Sep 17 00:00:00 2001 From: EYHN Date: Tue, 13 Aug 2024 14:25:33 +0800 Subject: [PATCH] refactor(infra): remove setimmediate (#7821) --- packages/common/infra/src/livedata/livedata.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/common/infra/src/livedata/livedata.ts b/packages/common/infra/src/livedata/livedata.ts index 742163ea7f..655515eaf3 100644 --- a/packages/common/infra/src/livedata/livedata.ts +++ b/packages/common/infra/src/livedata/livedata.ts @@ -495,7 +495,8 @@ export class LiveData throw this.poisonedError; } this.ops$.next('watch'); - setImmediate(() => { + // eslint-disable-next-line @typescript-eslint/no-floating-promises -- never throw + Promise.resolve().then(() => { this.ops$.next('unwatch'); }); return this.raw$.value;