Cache
Constructors
new Cache()
new Cache(): Cache
Returns
Cache
Methods
clearCache()
static clearCache(id?): Promise<void>
Clear the cached data related to this cache id. If not cache id provided => clear all cache ids
Parameters
Parameter | Type |
---|---|
id ? | string |
Returns
Promise
<void
>
clearPendingChanges()
static clearPendingChanges(): Promise<void>
Clear the list of pending changes without applying or syncing them.
Returns
Promise
<void
>
getCacheEntries()
static getCacheEntries(): Observable<string[]>
Return the list of cache ids saved in previous execute or observe
Returns
Observable
<string
[]>
getPendingChanges()
static getPendingChanges(): Promise<string>
Return a string containing all changes and there related files. This method can be used to "backup" pending changes at any point in time before a synchronisation
Returns
Promise
<string
>
getProcessingErrors()
static getProcessingErrors(): Observable<boolean>
Return an Observable which emit a new value for each Error encountered when processing data results asynchronously
Returns
Observable
<boolean
>
getProcessingStatus()
static getProcessingStatus(): Observable<CacheStatus>
Return an Observable which returns the current processing status of the Cache layer.
processing
is set to TRUE if the Cache is processing some queries or downloading files to keep the offline database up-to-date
Returns
Observable
<CacheStatus
>
hasPendingChanges()
static hasPendingChanges(): Observable<boolean>
Return an observable which gets TRUE if one or more changes must be synced with remoted database
Returns
Observable
<boolean
>
loadPendingChanges()
static loadPendingChanges(data): Promise<void>
Load the given pending changes into the local offline database
Parameters
Parameter | Type |
---|---|
data | string |
Returns
Promise
<void
>
synchroniseChanges()
static synchroniseChanges(): Observable<[number, number]>
Sync the local changes made offline with the online data source Returns an observable in the form [nbChanges, nbSyncedChanges]
Returns
Observable
<[number
, number
]>