There was an error while loading. Please reload this page.
1 parent 3eb1993 commit 3e97df0Copy full SHA for 3e97df0
1 file changed
frontend/src/v2/composables/useIsAlive/index.ts
@@ -1,15 +1,5 @@
1
// useIsAlive — tracks whether the owning effect scope is still active, so an
2
// async handler that resolves late can tell it's talking to a dead component.
3
-//
4
-// Replaces the manual pattern:
5
-// let unmounted = false;
6
-// onBeforeUnmount(() => { unmounted = true; });
7
8
-// Cleanup uses `onScopeDispose` (not `onBeforeUnmount`) so it also works from
9
-// a non-component effect scope, e.g. inside another composable.
10
11
-// Note: VueUse's `useMounted` is not a substitute — it only flips to `true` on
12
-// mount and never back to `false` on teardown.
13
import { onScopeDispose, shallowRef, type ShallowRef } from "vue";
14
15
export function useIsAlive(): ShallowRef<boolean> {
0 commit comments