feat: manage caldav tokens [addition] #1307

Merged
konrad merged 24 commits from dpschen/frontend:feature/caldav-tokens into main 2022-04-02 15:51:44 +00:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit b9fa08116d - Show all commits

View File

@ -80,13 +80,13 @@ import CaldavTokenModel from '@/models/caldavToken'
const service = new CaldavTokenService()
dpschen marked this conversation as resolved Outdated

I think we should always start the view components with the title composable.
Sometimes data fetching might need to be first of course.

I think we should always start the view components with the title composable. Sometimes data fetching might need to be first of course.
async function useToken(): ref<CaldavTokenModel[]> {
async function useTokens(): ref<CaldavTokenModel[]> {
const tokens = ref<CaldavTokenModel[]>([])
tokens.value = await service.getAll()

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
}

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.

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()