Skip to content

Latest commit

 

History

History
20 lines (10 loc) · 1005 Bytes

README.md

File metadata and controls

20 lines (10 loc) · 1005 Bytes

NgRx Cache Example

This repository demonstrates three different caching schemes for use in Angular with NgRx store, named Session Cache, (Auto) Refreshing Cache, and Expiring Cache.

The crux of the project are the icon.service.ts and color.service.ts . Most of the rest of it serves as boilerplate or beautification.

Session Cache: Data fetched from API once, persists in store lasts for life of session.

session cache screenshot

Auto Refreshing Cache: Observable tracks validity of data via expiration date value, Automatically fetches new data and updates store.

refreshing cache screenshot

Expiring Cache: Preflight request on creation of new observable, fetches fresh data if store data is expired.

expiring cache screenshot