diff --git a/src/sync-plugins/crud.ts b/src/sync-plugins/crud.ts index 5509542a..f3033c0c 100644 --- a/src/sync-plugins/crud.ts +++ b/src/sync-plugins/crud.ts @@ -131,11 +131,6 @@ function computeLastSync(data: any[], fieldUpdatedAt: string | undefined, fieldC return newLastSync; } -const queuedRetries = { - create: new Map(), - update: new Map(), - delete: new Map(), -}; function retrySet( params: SyncedSetParams, retry: RetryOptions | undefined, @@ -143,6 +138,11 @@ function retrySet( itemKey: string, itemValue: any, change: Change, + queuedRetries: { + create: Map; + update: Map; + delete: Map; + }, actionFn: (value: any, params: SyncedSetParams) => Promise, saveResult: (itemKey: string, itemValue: any, result: any, isCreate: boolean, change: Change) => void, ) { @@ -219,6 +219,11 @@ export function syncedCrud(); + const queuedRetries = { + create: new Map(), + update: new Map(), + delete: new Map(), + }; let asType = props.as as TAsOption; @@ -578,6 +583,7 @@ export function syncedCrud { @@ -599,6 +605,7 @@ export function syncedCrud