mirror of
https://github.com/immich-app/static-pages.git
synced 2026-09-30 13:23:05 +08:00
fix: export persisted state (#721)
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user