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 <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-18 14:22:54 +08:00
1 parent 42ddeb14e7
commit bd06aedb90
2 files changed
+8

No files matched your search

+4
View File
@@ -194,8 +194,10 @@ focus.
+ `key` + `key`
+ `value` + `value`
+ `scope`="memory" + `scope`="memory"
+ `then`=""
In-memory (or local/session) key write for SPA client state. Prefer `scope=memory` for tab-local app state. 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` = `spec` =
@@ -203,6 +205,8 @@ In-memory (or local/session) key write for SPA client state. Prefer `scope=memor
|----|-----|-------|-------| |----|-----|-------|-------|
| set | `key` | `value` | `scope` | | set | `key` | `value` | `scope` |
1. `then` != ""
**`spec` = > table.put in=spec at="then" value=then**
*> table.put in=None at="storage" value=spec* *> table.put in=None at="storage" value=spec*
## store_get ## store_get
+4
View File
@@ -193,8 +193,10 @@ import table:lib/table.mq.md
+ `键` + `键`
+ `值` + `值`
+ `作用域`="memory" + `作用域`="memory"
+ `然后`=""
SPA 客户端状态写入。优先 `作用域=memory`(页内内存)。 SPA 客户端状态写入。优先 `作用域=memory`(页内内存)。
可选 `然后`:写入后回调,参数含 `{ok, op, key, scope}`。
`spec` = `spec` =
@@ -202,6 +204,8 @@ SPA 客户端状态写入。优先 `作用域=memory`(页内内存)。
|----|-----|-------|-------| |----|-----|-------|-------|
| set | `键` | `值` | `作用域` | | set | `键` | `值` | `作用域` |
1. `然后` != ""
**`spec` = > table.put in=spec at="then" value=然后**
*> table.put in=None at="storage" value=spec* *> table.put in=None at="storage" value=spec*
## 存取 ## 存取