From bd06aedb90c64632a607beb9c67b930e56ff45be Mon Sep 17 00:00:00 2001 From: cflmy Date: Fri, 18 Sep 2026 14:22:54 +0800 Subject: [PATCH] fix(browser): pass optional then= through store_set Theme toggle wrote localStorage but never chained to apply_theme because store_set dropped then. Co-authored-by: Cursor --- lib/browser.mq.md | 4 ++++ lib/浏览器.mq.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/browser.mq.md b/lib/browser.mq.md index 09b6ea9..fcf6738 100644 --- a/lib/browser.mq.md +++ b/lib/browser.mq.md @@ -194,8 +194,10 @@ focus. + `key` + `value` + `scope`="memory" + + `then`="" In-memory (or local/session) key write for SPA client state. Prefer `scope=memory` for tab-local app state. +Optional `then` is called after the write with `{ok, op, key, scope}`. `spec` = @@ -203,6 +205,8 @@ In-memory (or local/session) key write for SPA client state. Prefer `scope=memor |----|-----|-------|-------| | set | `key` | `value` | `scope` | +1. `then` != "" + **`spec` = > table.put in=spec at="then" value=then** *> table.put in=None at="storage" value=spec* ## store_get diff --git a/lib/浏览器.mq.md b/lib/浏览器.mq.md index 72346fc..b25691f 100644 --- a/lib/浏览器.mq.md +++ b/lib/浏览器.mq.md @@ -193,8 +193,10 @@ import table:lib/table.mq.md + `键` + `值` + `作用域`="memory" + + `然后`="" SPA 客户端状态写入。优先 `作用域=memory`(页内内存)。 +可选 `然后`:写入后回调,参数含 `{ok, op, key, scope}`。 `spec` = @@ -202,6 +204,8 @@ SPA 客户端状态写入。优先 `作用域=memory`(页内内存)。 |----|-----|-------|-------| | set | `键` | `值` | `作用域` | +1. `然后` != "" + **`spec` = > table.put in=spec at="then" value=然后** *> table.put in=None at="storage" value=spec* ## 存取