Skip to content

AppCacheService

service

Service for saving or caching data on the users device. It uses the most efficient storage available (IndexDB, localstorage, …) on the device. Depending on the type of storage used, its limitations apply.

Clear storage, optionally filtered by a function.

clear(filter?: function): Observable<boolean>
NameTypeDescription
filterfunction

Get item from storage.

getItem(key: string): Observable<T>
NameTypeDescription
keystring

Get all storage keys.

getStorageKeys(): Observable<string[]>

Remove item from storage.

removeItem(key: string): Observable<boolean>
NameTypeDescription
keystring

Set item in storage.

setItem(key: string, value: T): Observable<boolean>
NameTypeDescription
keystring
valueT
setStorage(options: any): Observable<any>
NameTypeDescription
optionsany