refactor: tidy composables
This commit is contained in:
parent
bf8070c4b9
commit
e0741d58a9
14 changed files with 177 additions and 175 deletions
11
composables/masto/masto.ts
Normal file
11
composables/masto/masto.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
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 })
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue