Continuous sync (#320)

* Continuous sync

* Mobile dep upgrade
This commit is contained in:
Zef Hemel
2023-01-20 16:08:01 +01:00
committed by GitHub
parent 3fb393baf3
commit 2577a2db32
17 changed files with 416 additions and 224 deletions
+18 -2
View File
@@ -9,7 +9,7 @@ export type SyncEndpoint = {
// Perform a sync with the server, based on the given status (to be persisted)
// returns a new sync status to persist
export function sync(
export function syncAll(
endpoint: SyncEndpoint,
snapshot: Record<string, SyncStatusItem>,
): Promise<
@@ -19,7 +19,23 @@ export function sync(
error?: string;
}
> {
return syscall("sync.sync", endpoint, snapshot);
return syscall("sync.syncAll", endpoint, snapshot);
}
// Perform a sync with the server, based on the given status (to be persisted)
// returns a new sync status to persist
export function syncFile(
endpoint: SyncEndpoint,
snapshot: Record<string, SyncStatusItem>,
name: string,
): Promise<
{
snapshot: Record<string, SyncStatusItem>;
operations: number;
error?: string;
}
> {
return syscall("sync.syncFile", endpoint, snapshot, name);
}
// Checks the sync endpoint for connectivity and authentication, throws and Error on failure