Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

refactor(infra): remove setimmediate (#7821)

EYHN1db6b9fe3b33
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<T = unknown>
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;