MCPcopy
hub / github.com/angular-ui/ui-grid / createLocalCacheLookup

Function createLocalCacheLookup

lib/test/angular/1.5.0/angular-animate.js:836–861  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

834}
835
836function createLocalCacheLookup() {
837 var cache = Object.create(null);
838 return {
839 flush: function() {
840 cache = Object.create(null);
841 },
842
843 count: function(key) {
844 var entry = cache[key];
845 return entry ? entry.total : 0;
846 },
847
848 get: function(key) {
849 var entry = cache[key];
850 return entry && entry.value;
851 },
852
853 put: function(key, value) {
854 if (!cache[key]) {
855 cache[key] = { total: 1, value: value };
856 } else {
857 cache[key].total++;
858 }
859 }
860 };
861}
862
863// we do not reassign an already present style value since
864// if we detect the style property value again we may be

Callers 1

angular-animate.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected