Skip to Content

Available on client only

syncOne(basicFilter: Partial, options: SyncOneOptions, onChange: OnchangeOne, onError?: OnErrorHandler): Promise<SingleSyncHandles>

Parameters

  • basicFilter required Partial

    Make all properties in T optional

  • options required SyncOneOptions

    • onChange optional MultiChangeListener

      Data change listener. Called on first sync and every time the data changes

    • skipFirstTrigger optional boolean

      If true then the first onChange trigger is skipped

    • select optional AnyObject | ”*” | undefined

    • storageType optional “object” | “array” | “localStorage” | undefined

      Default is “object”. “localStorage” will persist the data

    • patchText optional boolean

      If true then only the delta of the text field is sent to server. Full text is sent if an error occurs

    • patchJSON optional boolean

    • onReady optional () => void

    • handlesOnData optional boolean

  • onChange required OnchangeOne

  • onError optional OnErrorHandler

Return type

SingleSyncHandles

CRUD handles added if initialised with handlesOnData = true

  • $get required () => T | undefined
  • $find required (idObj: Partial<T>) => T | undefined
  • $unsync required () => any
  • $delete required () => void
  • $update required <OPTS extends $UpdateOpts>(newData: OPTS extends { deepMerge: true; } ? DeepPartial<T> : Partial<T>, opts?: OPTS | undefined) => any
  • $cloneSync required CloneSync
  • $cloneMultiSync required CloneMultiSync
Last updated on