Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. interface CacheContent {
  2. expiry: number;
  3. value: any;
  4. }
  5.  
  6. /**
  7. * Cache Service is an observables based in-memory cache implementation
  8. * Keeps track of in-flight observables and sets a default expiry for cached values
  9. * @export
  10. * @class CacheService
  11. */
  12. export class CacheService {
  13. private cache: Map<string, CacheContent> = new Map<string, CacheContent>();
  14. private inFlightObservables: Map<string, Subject<any>> = new Map<string, Subject<any>>();
  15. readonly DEFAULT_MAX_AGE: number = 300000;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement