main code

This commit is contained in:
Akshat Mehta
2025-11-23 11:03:57 +05:30
parent 0737ead33d
commit edd5728428
705 changed files with 80627 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();
}