routie dev init since i didn't adhere to any proper guidance up until now

This commit is contained in:
2026-04-29 22:27:29 -06:00
commit e1dabb71e2
15301 changed files with 3562618 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
// Utilities
import { effectScope, onScopeDispose, watch } from 'vue';
// Types
export function useToggleScope(source, fn) {
let scope;
function start() {
scope = effectScope();
scope.run(() => fn.length ? fn(() => {
scope?.stop();
start();
}) : fn());
}
watch(source, active => {
if (active && !scope) {
start();
} else if (!active) {
scope?.stop();
scope = undefined;
}
}, {
immediate: true
});
onScopeDispose(() => {
scope?.stop();
});
}
//# sourceMappingURL=toggleScope.js.map