UNPKG

1.14 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6
7var _CacheEntry = require("./CacheEntry");
8
9var _CacheEntry2 = _interopRequireDefault(_CacheEntry);
10
11function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
13/**
14 * Factory for creating instances of {@link CacheEntry}.
15 */
16class CacheFactory {
17 static get $dependencies() {
18 return [];
19 }
20 /**
21 * Create a new instance of {@link CacheEntry} with value and ttl.
22 *
23 * @param {*} value The cache entry value.
24 * @param {?number=} ttl Cache entry time to live in milliseconds. The
25 * entry will expire after the specified amount of milliseconds.
26 * @return {CacheEntry} The created cache entry.
27 */
28
29
30 createCacheEntry(value, ttl) {
31 return new _CacheEntry2.default(value, ttl);
32 }
33
34}
35
36exports.default = CacheFactory;
37
38typeof $IMA !== 'undefined' && $IMA !== null && $IMA.Loader && $IMA.Loader.register('ima/cache/CacheFactory', [], function (_export, _context) {
39 'use strict';
40 return {
41 setters: [],
42 execute: function () {
43 _export('default', exports.default);
44 }
45 };
46});