fix: export persisted state (#721)

This commit is contained in:
Jason Rasmussen
2026-08-21 18:18:24 +00:00
committed by GitHub
parent f5c293ae07
commit b5735a7c32
2 changed files with 4 additions and 3 deletions
+1
View File
@@ -118,6 +118,7 @@ export * from '$lib/services/toast-manager.svelte.js';
export * from '$lib/services/translation.svelte.js';
export * from '$lib/state/locale-state.svelte.js';
export { isModalOpen } from '$lib/state/modal-state.svelte.js';
export * from '$lib/state/persisted.js';
export * from '$lib/types.js';
export * from '$lib/utilities/byte-units.js';
export * from '$lib/utilities/common.js';
+3 -3
View File
@@ -1,12 +1,12 @@
import { browser } from '$app/environment';
import { createSubscriber } from 'svelte/reactivity';
type PersistedBaseOptions<T> = {
export type PersistedBaseOptions<T> = {
read: (key: string) => T | undefined;
write: (key: string, value: T) => void;
};
class PersistedBase<T> {
export class PersistedBase<T> {
#value: T;
#subscribe: () => void;
#update = () => {};
@@ -40,7 +40,7 @@ class PersistedBase<T> {
}
}
type PersistedLocalStorageOptions<T> = {
export type PersistedLocalStorageOptions<T> = {
serializer?: {
stringify(value: T): string;
parse(text: string): T;