feat: create atproto oauth login
This commit is contained in:
21
src/hooks/useFollows.hook.ts
Normal file
21
src/hooks/useFollows.hook.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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 }
|
||||
}
|
||||
Reference in New Issue
Block a user