feat: manage caldav tokens [addition] #1307
|
@ -80,13 +80,13 @@ import CaldavTokenModel from '@/models/caldavToken'
|
|||
|
||||
const service = new CaldavTokenService()
|
||||
|
||||
dpschen marked this conversation as resolved
Outdated
|
||||
async function useToken(): ref<CaldavTokenModel[]> {
|
||||
async function useTokens(): ref<CaldavTokenModel[]> {
|
||||
const tokens = ref<CaldavTokenModel[]>([])
|
||||
tokens.value = await service.getAll()
|
||||
dpschen
commented
I think (not sure) that using some kind of reactive for stuff like this is a good pattern, because this way you can always extract parts in a composable if needed later. Often we want to do this after a component has grown in size because some stuff was added. I think (not sure) that using some kind of reactive for stuff like this is a good pattern, because this way you can always extract parts in a composable if needed later. Often we want to do this after a component has grown in size because some stuff was added.
|
||||
return tokens
|
||||
}
|
||||
|
||||
dpschen
commented
I decided to flatten this again. Sorry for this… I'm also still lerning the composition api =) I decided to flatten this again. Sorry for this… I'm also still lerning the composition api =)
Originally I thought that this might be reused in other components.
|
||||
const tokens = useToken()
|
||||
const tokens = useTokens()
|
||||
|
||||
const store = useStore()
|
||||
const {t} = useI18n()
|
||||
|
|
Reference in New Issue
I think we should always start the view components with the title composable.
Sometimes data fetching might need to be first of course.