1
0
mirror of https://github.com/elk-zone/elk synced 2024-12-03 17:28:11 +09:00
elk/composables/masto/masto.ts
2023-01-07 02:43:49 +08:00

12 lines
348 B
TypeScript

import type { ElkMasto } from '~/types'
export const useMasto = () => useNuxtApp().$masto as ElkMasto
export const isMastoInitialised = computed(() => process.client && useMasto().loggedIn.value)
export const onMastoInit = (cb: () => unknown) => {
watchOnce(isMastoInitialised, () => {
cb()
}, { immediate: isMastoInitialised.value })
}