@agoric/store 0.9.3-dev-f3c2b65.0 → 0.9.3-dev-1f4333e.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -33
- package/package.json +2 -4
- package/src/legacy/legacyMap.js +3 -2
- package/src/legacy/legacyWeakMap.js +3 -1
package/README.md
CHANGED
|
@@ -22,36 +22,6 @@ Store adds some additional functionality on top of Map.
|
|
|
22
22
|
|
|
23
23
|
See `makeScalarWeakMapStore` for the wrapper around JavaScript's WeakMap abstraction.
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
that are compatible with large, synchronous secondary storage that can be paged
|
|
29
|
-
in and out of local memory.
|
|
30
|
-
|
|
31
|
-
```js
|
|
32
|
-
import { makeExternalStore } from '@agoric/store';
|
|
33
|
-
|
|
34
|
-
// Here is us defining an instance store for 'hello' objects.
|
|
35
|
-
const estore = makeExternalStore((msg = 'Hello') => ({
|
|
36
|
-
hello(nickname) {
|
|
37
|
-
return `${msg}, ${nickname}!`;
|
|
38
|
-
},
|
|
39
|
-
}));
|
|
40
|
-
|
|
41
|
-
const h = estore.makeInstance('Hi');
|
|
42
|
-
h.hello('friend') === 'Hi, friend!';
|
|
43
|
-
const wm = estore.makeWeakMap('Hello object');
|
|
44
|
-
wm.init(h, 'data');
|
|
45
|
-
// ... time passes and h is paged out and reloaded.
|
|
46
|
-
wm.get(h) === 'data';
|
|
47
|
-
wm.set(h, 'new-data');
|
|
48
|
-
// ... time passes and h is paged out and reloaded.
|
|
49
|
-
map.delete(h);
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Note that when you import and use the `makeExternalStore` function, the platform
|
|
53
|
-
you are running on may rewrite your code to use a more scalable implementation
|
|
54
|
-
of that function. If it is not rewritten, then `makeExternalStore` will use
|
|
55
|
-
`makeMemoryExternalStore`, a full-featured, though in-memory-only
|
|
56
|
-
implementation. If you don't desire rewriting, then use
|
|
57
|
-
`makeMemoryExternalStore` directly.
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
Be aware that both `@agoric/base-zone` and this package `@agoric/store` will move from the agoric-sdk repository to the endo repository and likely renamed `@endo/zone` and `@endo/store`. At that time, we will first deprecate the versions here, then replace them with deprecated stubs that reexport from their new home. We hope to eventually remove even these stubs, depending on the compat cost at that time.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/store",
|
|
3
|
-
"version": "0.9.3-dev-
|
|
3
|
+
"version": "0.9.3-dev-1f4333e.0+1f4333e",
|
|
4
4
|
"description": "Wrapper for JavaScript map",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -30,14 +30,12 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@agoric/assert": "0.6.1-dev-f3c2b65.0+f3c2b65",
|
|
34
33
|
"@endo/exo": "^1.1.0",
|
|
35
34
|
"@endo/marshal": "^1.1.0",
|
|
36
35
|
"@endo/pass-style": "^1.1.0",
|
|
37
36
|
"@endo/patterns": "^1.1.0"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
40
|
-
"@agoric/time": "0.3.3-dev-f3c2b65.0+f3c2b65",
|
|
41
39
|
"@endo/init": "^1.0.2",
|
|
42
40
|
"@endo/ses-ava": "^1.1.0",
|
|
43
41
|
"ava": "^5.3.0"
|
|
@@ -62,5 +60,5 @@
|
|
|
62
60
|
"typeCoverage": {
|
|
63
61
|
"atLeast": 85.52
|
|
64
62
|
},
|
|
65
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "1f4333e2e31d7d01a746808599a174c0f914d9a0"
|
|
66
64
|
}
|
package/src/legacy/legacyMap.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { q, Fail } from '@agoric/assert';
|
|
2
|
-
|
|
3
1
|
import '../types.js';
|
|
4
2
|
|
|
3
|
+
// TODO, once migrated to endo, import from @endo/errors instead
|
|
4
|
+
const { Fail, quote: q } = assert;
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* This module and its fraternal sibling legacyWeakMap exist only to ease a
|
|
7
8
|
* transition to the modern `store` system, are deprecated, and will eventually
|