Move rune-based state modules into lib/state

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-22 14:09:36 +02:00
co-authored by Claude Sonnet 5
parent 63018a7c72
commit f98c47f5ed
14 changed files with 160 additions and 13 deletions
+18
View File
@@ -0,0 +1,18 @@
export function createToggle(initial = false) {
let open = $state(initial);
return {
get open() {
return open;
},
show() {
open = true;
},
close() {
open = false;
},
toggle() {
open = !open;
}
};
}