Skip to content

Commit 526ae74

Browse files
committed
refactor: change access modifiers from private to protected in SyncManager
1 parent 9c7ad9f commit 526ae74

File tree

1 file changed

+14
-14
lines changed
  • packages/signaldb/src/SyncManager

1 file changed

+14
-14
lines changed

packages/signaldb/src/SyncManager/index.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,20 @@ export default class SyncManager<
7777
ItemType extends BaseItem<IdType> = BaseItem,
7878
IdType = any,
7979
> {
80-
private options: Options<CollectionOptions, ItemType, IdType>
81-
private collections: Map<string, [
80+
protected options: Options<CollectionOptions, ItemType, IdType>
81+
protected collections: Map<string, [
8282
Collection<ItemType, IdType, any>,
8383
SyncOptions<CollectionOptions>,
8484
]> = new Map()
8585

86-
private changes: Collection<Change<ItemType>, string>
87-
private snapshots: Collection<Snapshot<ItemType>, string>
88-
private syncOperations: Collection<SyncOperation, string>
89-
private remoteChanges: Collection<Change, string>
90-
private syncQueues: Map<string, PromiseQueue> = new Map()
91-
private persistenceReady: Promise<void>
92-
private isDisposed = false
93-
private instanceId = randomId()
86+
protected changes: Collection<Change<ItemType>, string>
87+
protected snapshots: Collection<Snapshot<ItemType>, string>
88+
protected syncOperations: Collection<SyncOperation, string>
89+
protected remoteChanges: Collection<Change, string>
90+
protected syncQueues: Map<string, PromiseQueue> = new Map()
91+
protected persistenceReady: Promise<void>
92+
protected isDisposed = false
93+
protected instanceId = randomId()
9494

9595
/**
9696
* @param options Collection options
@@ -172,7 +172,7 @@ export default class SyncManager<
172172
this.syncOperations.setMaxListeners(1000)
173173
}
174174

175-
private getSyncQueue(name: string) {
175+
protected getSyncQueue(name: string) {
176176
if (this.syncQueues.get(name) == null) {
177177
this.syncQueues.set(name, new PromiseQueue())
178178
}
@@ -303,11 +303,11 @@ export default class SyncManager<
303303
})
304304
}
305305

306-
private deboucedPush = debounce((name: string) => {
306+
protected deboucedPush = debounce((name: string) => {
307307
this.pushChanges(name).catch(() => { /* error handler is called in sync */ })
308308
}, 100)
309309

310-
private schedulePush(name: string) {
310+
protected schedulePush(name: string) {
311311
this.deboucedPush(name)
312312
}
313313

@@ -434,7 +434,7 @@ export default class SyncManager<
434434
})
435435
}
436436

437-
private async syncWithData(
437+
protected async syncWithData(
438438
name: string,
439439
data: LoadResponse<ItemType>,
440440
) {

0 commit comments

Comments
 (0)