Files
remanso/src/hooks/useFollows.hook.ts
2026-03-28 09:38:55 +01:00

22 lines
434 B
TypeScript

import { Ref, ref, watch } from "vue"
import { getFollows } from "@/modules/atproto/service/getFollows"
export const useFollows = (did: Ref<string | null>) => {
const follows = ref<Set<string>>(new Set())
watch(
did,
async (value) => {
if (value) {
follows.value = await getFollows(value)
} else {
follows.value = new Set()
}
},
{ immediate: true }
)
return { follows }
}