mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix: add prefer-readonly rule (#5122)
This commit is contained in:
@@ -5,8 +5,8 @@ const logger = new DebugLogger('affine:blob-engine');
|
||||
|
||||
export class BlobEngine {
|
||||
constructor(
|
||||
private local: BlobStorage,
|
||||
private remotes: BlobStorage[]
|
||||
private readonly local: BlobStorage,
|
||||
private readonly remotes: BlobStorage[]
|
||||
) {}
|
||||
|
||||
get storages() {
|
||||
|
||||
@@ -15,12 +15,12 @@ interface SyncUpdateSender {
|
||||
* - retryable, allow retry when previous sync request failed but with retry flag been set to true
|
||||
*/
|
||||
export class BatchSyncSender {
|
||||
private buffered: Uint8Array[] = [];
|
||||
private readonly buffered: Uint8Array[] = [];
|
||||
private job: Promise<void> | null = null;
|
||||
private started = true;
|
||||
|
||||
constructor(
|
||||
private guid: string,
|
||||
private readonly guid: string,
|
||||
private readonly rawSender: SyncUpdateSender
|
||||
) {}
|
||||
|
||||
|
||||
@@ -63,9 +63,9 @@ export class SyncEngine {
|
||||
private abort = new AbortController();
|
||||
|
||||
constructor(
|
||||
private rootDoc: Doc,
|
||||
private local: Storage,
|
||||
private remotes: Storage[]
|
||||
private readonly rootDoc: Doc,
|
||||
private readonly local: Storage,
|
||||
private readonly remotes: Storage[]
|
||||
) {
|
||||
this._status = {
|
||||
step: SyncEngineStep.Stopped,
|
||||
|
||||
@@ -69,8 +69,8 @@ export class SyncPeer {
|
||||
logger = new DebugLogger('affine:sync-peer:' + this.name);
|
||||
|
||||
constructor(
|
||||
private rootDoc: Doc,
|
||||
private storage: Storage
|
||||
private readonly rootDoc: Doc,
|
||||
private readonly storage: Storage
|
||||
) {
|
||||
this.logger.debug('peer start');
|
||||
|
||||
@@ -150,7 +150,7 @@ export class SyncPeer {
|
||||
}
|
||||
}
|
||||
|
||||
private state: {
|
||||
private readonly state: {
|
||||
connectedDocs: Map<string, Doc>;
|
||||
pushUpdatesQueue: AsyncQueue<{
|
||||
docId: string;
|
||||
|
||||
Reference in New Issue
Block a user