snapback4 0.0.10 → 0.0.12

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 CHANGED
@@ -320,7 +320,9 @@ flips the link.
320
320
  arguments derived from the data (a reference is the table's first row,
321
321
  a principal the persona, a text the shortest that fits), prints the
322
322
  meters beside the ceilings and the arguments it used, and names any
323
- query it could not run.
323
+ query it could not run. A query's own `require` refusing a derived
324
+ argument (the persona is not in that group) is reported, not counted
325
+ as a failure; run it with your arguments to see its meters.
324
326
  - **`snapback4 check [--cost] [--json]`** compiles, writes
325
327
  `snapback/generated/api.ts` (`Rows`, `Ops`, `api`), and prints every
326
328
  diagnostic with its site and rewrite; `--cost` adds each site's
package/dist/client.js CHANGED
@@ -213,6 +213,13 @@ export function createClient(options) {
213
213
  subscribe(notifyMe) {
214
214
  mine.add(notifyMe);
215
215
  own.subscribers.add(notifyMe);
216
+ // A screen that closed this key a moment ago (React unmounts the
217
+ // old component before the new one subscribes) may have removed
218
+ // the watch: put it back, and refresh it.
219
+ if (watches.get(own.key) !== own) {
220
+ watches.set(own.key, own);
221
+ void refresh(own);
222
+ }
216
223
  return () => {
217
224
  mine.delete(notifyMe);
218
225
  own.subscribers.delete(notifyMe);
package/dist/local.js CHANGED
@@ -284,6 +284,14 @@ export async function createLocalClient(options) {
284
284
  subscribe(listener) {
285
285
  mine.add(listener);
286
286
  own.subscribers.add(listener);
287
+ // A screen that closed this key a moment ago (React unmounts the
288
+ // old component before the new one subscribes) may have removed
289
+ // the watch: put it back, and refresh it, so no subscriber is
290
+ // left on a watch nothing updates.
291
+ if (watches.get(own.key) !== own) {
292
+ watches.set(own.key, own);
293
+ void rerun(own);
294
+ }
287
295
  return () => { mine.delete(listener); own.subscribers.delete(listener); };
288
296
  },
289
297
  close() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snapback4",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "type": "module",
5
5
  "description": "Snapback 4: the card (contract), the online and local-first clients (IndexedDB, SQLite), React hooks, sign-in, a labelled mock, and the `snapback4` CLI. LLP 3000.",
6
6
  "bin": {
@@ -42,7 +42,7 @@
42
42
  "README.md"
43
43
  ],
44
44
  "optionalDependencies": {
45
- "snapback4-darwin-arm64": "0.0.10"
45
+ "snapback4-darwin-arm64": "0.0.12"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "tsc -p tsconfig.build.json",