ngx-common-cache
v1.0.0
Published
Angular Common Cache library
Downloads
3
Maintainers
Readme
Ngx-common-cache
Ngx-common-cache provides services and interfaces for various storage types in Angular. It's primary use is as a wrapper for the browser's built-in Web Storage API. An extension for the IndexedDB API can be found in ngx-indexeddb.
This library includes three types of storage
- MemoryStorage
- LocalStorage
- SessionStorage
And implements the Cache interface
interface Cache {
get<T>(key: string): Observable<T>;
getOrCreate<T>(key: string, fetcher: () => Observable<T>): Observable<T>;
put(key: string, value: any): void;
clear(): void;
updateChecksum(serverModelChecksum: number): void;
}
This library is packaged in the Angular Package Format using ng-packagr to FESM2015, FESM5, UMD and ready for consumption with Angular CLI, Webpack and SystemJS.