1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-02 23:19:57 +00:00
elk/composables/masto/masto.ts

12 lines
348 B
TypeScript
Raw Normal View History

2023-01-06 18:40:15 +00:00
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 })
}