-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy pathindex.js
More file actions
35 lines (29 loc) · 839 Bytes
/
index.js
File metadata and controls
35 lines (29 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import angular from 'angular'
import {
BinaryHeap,
CacheFactory,
defaults,
utils
} from '../node_modules/cachefactory/dist/cachefactory.es2015.js'
utils.equals = angular.equals
utils.isObject = angular.isObject
utils.fromJson = angular.fromJson
function BinaryHeapProvider () {
this.$get = function () { return BinaryHeap }
}
function CacheFactoryProvider () {
this.defaults = defaults
this.defaults.storagePrefix = 'angular-cache.caches.'
this.$get = ['$q', function ($q) {
utils.Promise = $q
var cacheFactory = new CacheFactory()
Object.defineProperty(cacheFactory, 'defaults', {
value: defaults
})
return cacheFactory
}]
}
angular.module('angular-cache', [])
.provider('BinaryHeap', BinaryHeapProvider)
.provider('CacheFactory', CacheFactoryProvider)
export default 'angular-cache'