svas 0.1.2 → 0.1.4

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.
@@ -123,6 +123,8 @@ export class Collection {
123
123
  this.fetch().then((items) => {
124
124
  if (!(items instanceof Error))
125
125
  this.replace(items);
126
+ else
127
+ this.store.set(items);
126
128
  });
127
129
  this.timestamp = Date.now();
128
130
  }
package/dist/value.js CHANGED
@@ -23,9 +23,11 @@ class Value {
23
23
  }
24
24
  update(updater) {
25
25
  this.store.update((value) => {
26
+ const updated = updater(value);
26
27
  if (this.map)
27
- value = this.map(value);
28
- return updater(value);
28
+ return this.map(updated);
29
+ else
30
+ return updated;
29
31
  });
30
32
  }
31
33
  subscribe(run, invalidate) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svas",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",