1.0.0 • Published 2 years ago

ngx-caching v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

ngx-utils

Angular library that enables developer accessible browser caching by providing a CacheService and a HttpCacheService.

📝 Table of Contents

🧐 About

This Angular library provides two services:

  • CacheService: which interacts directly with the browser local/session storage
  • HttpCacheService: which is a wrapper(decorator) around Angular HttpClient that offers the ability to cache any request that you want to (including post request) and offers the results as a Observable of the desired type, exactly as HttpClient.

🏁 Getting Started

To use this library you should have at least Angular 13. Installation of this library can be done using the following commands, depending on your package manager.

  • npm: npm i ngx-caching
  • yarn yarn add ngx-caching

🎈 Usage

The following is a basic usage example of the HttpCacheService:

...
import {HttpCacheService} from "ngx-caching";
...

constructor(private configService: ConfigService, private httpCached: HttpCacheService) { }

getValuesByType(typeId: number):Observable<any> {
 return this.httpCached.get(this.configService.getPath('dictionary', 'entries', {typeId}));
}

In the above example, the values that will be retrieved will also be cached, so any subsequent subscription to this method will result in a cache look-up rather than another HTTP request.

⛏️ Built Using

✍️ Authors

1.0.0

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.9

2 years ago

0.0.16

2 years ago

0.0.8

2 years ago

0.0.17

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago