Last active
August 21, 2017 03:26
-
-
Save ccnokes/9fb6481ff82833c5e23bf01aa3fdfb11 to your computer and use it in GitHub Desktop.
angularJS LRU cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create an LRU (least recently used) cache with up to 10 entries | |
const lru = $cacheFactory('my-cache', { capacity: 10 }); | |
$http.get('http://pokeapi.co/api/v2/pokemon/1/', { | |
cache: lru | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment