Revision 5c685518
Added by koszko about 2 years ago
common/storage_client.js | ||
---|---|---|
8 | 8 |
/* |
9 | 9 |
* IMPORTS_START |
10 | 10 |
* IMPORT CONNECTION_TYPE |
11 |
* IMPORT TYPE_PREFIX |
|
12 | 11 |
* IMPORT list_prefixes |
13 | 12 |
* IMPORT make_once |
14 | 13 |
* IMPORT browser |
... | ... | |
47 | 46 |
setTimeout(resolve, 0, message.result); |
48 | 47 |
} |
49 | 48 |
|
50 |
function list(name, prefix) |
|
51 |
{ |
|
52 |
return {prefix, name, listeners : new Set()}; |
|
53 |
} |
|
54 |
|
|
55 |
var scripts = list("scripts", TYPE_PREFIX.SCRIPT); |
|
56 |
var bags = list("bags", TYPE_PREFIX.BAG); |
|
57 |
var pages = list("pages", TYPE_PREFIX.PAGE); |
|
49 |
const list_by_prefix = {}; |
|
58 | 50 |
|
59 |
const list_by_prefix = { |
|
60 |
[TYPE_PREFIX.SCRIPT] : scripts, |
|
61 |
[TYPE_PREFIX.BAG] : bags, |
|
62 |
[TYPE_PREFIX.PAGE] : pages |
|
63 |
}; |
|
51 |
for (const prefix of list_prefixes) |
|
52 |
list_by_prefix[prefix] = {prefix, listeners : new Set()}; |
|
64 | 53 |
|
65 | 54 |
var resolve_init; |
66 | 55 |
|
Also available in: Unified diff
store repository URLs in settings