Hildebrandt Tobias
04/29/2025, 12:10 PMReadOnlyArray<T> but they have a little wrapper like ColumnFiltersTableState which only has 1 field var columnFilters: ReadonlyArray<ColumnFilter>.
I want to save the user's settings like sorting, filters, etc. to localStorage .
The thing is, since ColumnFiltersTableState is an external interface I cannot reify it for deserialization.
And I cannot just use ReadonlyArray<ColumnFilter> directly since it doesn't get explicitly exposed by TanStack,
so I get ReferenceError: ColumnFilter is not defined when I try it like this.
I also can't JSON.Stringify since that would create problems in other places, it sometimes adds _1 to fields.Artem Kobzar
04/29/2025, 2:14 PMHildebrandt Tobias
04/29/2025, 2:17 PMstorageKotlin and storageJs function one is reified and uses kotlinx the other isn't and uses kotlin.js.JSON.
Currently testing if everything works.turansky
04/29/2025, 2:18 PMHildebrandt Tobias
04/29/2025, 2:19 PMJSON.parse tucked away in abstractions.turansky
04/29/2025, 2:19 PMstringify you can use ReplacerHildebrandt Tobias
04/29/2025, 2:20 PMjson.encodeToString even worked, the main issue was parsing it back from localStorage.
Thanks for the answers.