Keep SQLite authoritative after completed migration even when legacy JSON is later invalid, reject non-object config documents before any migration state is written, and guard async secret masking by input generation. Persist renderer-facing config and queue mutations before updating memory so SQLite errors reject IPC calls and retain the last durable queue snapshot.
6 lines
190 B
TypeScript
6 lines
190 B
TypeScript
export function persistStateChange<T>(current: T, createNext: (current: T) => T, persist: (next: T) => void): T {
|
|
const next = createNext(current);
|
|
persist(next);
|
|
return next;
|
|
}
|