Fix: change inner workings of how history is kept, should improve performance

This commit is contained in:
Pieter Vander Vennet 2025-04-01 14:10:13 +02:00
parent 27ae31afe7
commit 7c57047d30
3 changed files with 102 additions and 91 deletions

View file

@ -807,7 +807,7 @@ export class UIEventSource<T> extends Store<T> implements Writable<T> {
)
}
static asObject<T extends object>(
static asObject<T extends object | string>(
stringUIEventSource: UIEventSource<string>,
defaultV: T
): UIEventSource<T> {
@ -819,7 +819,7 @@ export class UIEventSource<T> extends Store<T> implements Writable<T> {
try {
return <T>JSON.parse(str)
} catch (e) {
console.error("Could not parse value", str, "due to", e)
console.error("Could not parse value", str, "due to", e, "; the underlying data store has tag", stringUIEventSource.tag)
return defaultV
}
},