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

Function createLocalCacheLookup

lib/test/angular/1.7.0/angular-animate.js:817–842  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

815}
816
817function createLocalCacheLookup() {
818 var cache = Object.create(null);
819 return {
820 flush: function() {
821 cache = Object.create(null);
822 },
823
824 count: function(key) {
825 var entry = cache[key];
826 return entry ? entry.total : 0;
827 },
828
829 get: function(key) {
830 var entry = cache[key];
831 return entry && entry.value;
832 },
833
834 put: function(key, value) {
835 if (!cache[key]) {
836 cache[key] = { total: 1, value: value };
837 } else {
838 cache[key].total++;
839 }
840 }
841 };
842}
843
844// we do not reassign an already present style value since
845// 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