init commit

This commit is contained in:
rxliuli
2025-11-04 05:03:50 +08:00
commit bce557cc2d
1396 changed files with 172991 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { type Writable, writable } from 'svelte/store';
type FolderState = Writable<boolean>;
const folderStates = new Map<string, FolderState>();
export function subscribeFolderOpenState(
id: string,
defaultState?: boolean,
): FolderState {
let stateById = folderStates.get(id);
if (!stateById) {
folderStates.set(id, writable(defaultState ?? false));
stateById = folderStates.get(id);
}
return stateById;
}
export function resetFoldersOpenState() {
folderStates.clear();
}