UNPKG

339 BPlain TextView Raw
1import Resource from './resource';
2
3type CacheEntry = [
4 0,
5 Resource
6] | [
7 1,
8 Promise<Resource>
9];
10
11/**
12 * This object is responsible for caching resources.
13 *
14 * It holds references to all resource objects.
15 */
16export default class Cache {
17
18 cache: Map<string, CacheEntry>;
19
20 constructor() {
21
22 this.cache = new Map();
23
24 }
25
26}