@novasamatech/storage-adapter 0.7.5 → 0.7.7

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/dist/fieldView.js CHANGED
@@ -7,10 +7,12 @@ export function fieldView({ storage, initial, key, from, to, autosync = true })
7
7
  },
8
8
  write(value) {
9
9
  const data = to(value);
10
- if (data !== null) {
11
- return storage.write(key, data).map(() => value);
10
+ // `to` returning null means "no representation"; clear the key so
11
+ // persisted state stays in sync with `value`.
12
+ if (data === null) {
13
+ return storage.clear(key).map(() => null);
12
14
  }
13
- return okAsync(null);
15
+ return storage.write(key, data).map(() => value);
14
16
  },
15
17
  clear() {
16
18
  return storage.clear(key);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@novasamatech/storage-adapter",
3
3
  "type": "module",
4
- "version": "0.7.5",
4
+ "version": "0.7.7",
5
5
  "description": "Statement store integration",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {