DUF
DUF
SSolidJS
Created by DUF on 7/11/2024 in #support
Continuos refetches using Solid tanstack, / Reactivity logic?
createResource doesn't Cache does it?
23 replies
SSolidJS
Created by DUF on 7/11/2024 in #support
Continuos refetches using Solid tanstack, / Reactivity logic?
refech on windows focus
23 replies
SSolidJS
Created by DUF on 7/11/2024 in #support
Continuos refetches using Solid tanstack, / Reactivity logic?
v5 tanstack mentions: const query = createQuery(() => ({ queryKey: ['todos'], queryFn: fetchTodos, }))
23 replies
SSolidJS
Created by DUF on 7/11/2024 in #support
Continuos refetches using Solid tanstack, / Reactivity logic?
Yeah, I'm realizing that as well. I'm new to solid js way. Thanks for the feedback!
23 replies
SSolidJS
Created by DUF on 7/11/2024 in #support
Continuos refetches using Solid tanstack, / Reactivity logic?
Or maybe because I was passing missionGroups.data as props instead of the reactive missionGroups (from createQuery)?
23 replies
SSolidJS
Created by DUF on 7/11/2024 in #support
Continuos refetches using Solid tanstack, / Reactivity logic?
You are right, i was able to fix it already thou seems like calling functions when passing props is a bad idea, i just passed the CreateQueryResult<Tmboard.GroupMissions[][], Error> as prop and handle the data inside the children
23 replies
SSolidJS
Created by DUF on 7/11/2024 in #support
Continuos refetches using Solid tanstack, / Reactivity logic?
import type { Tmboard } from '#/shared/types'
import { trpc } from '@/utils/trpc'
import { createQuery } from '@tanstack/solid-query'

export const useWeekViewMissions = (date: string) => {
return createQuery<Tmboard.GroupMissions[][]>(() => ({
queryKey: ['getWeekMissions', { date }],
queryFn: () => trpc.mboard.getWeekMissions.query({ date: date }),
}))
}

export default useWeekViewMissions
import type { Tmboard } from '#/shared/types'
import { trpc } from '@/utils/trpc'
import { createQuery } from '@tanstack/solid-query'

export const useWeekViewMissions = (date: string) => {
return createQuery<Tmboard.GroupMissions[][]>(() => ({
queryKey: ['getWeekMissions', { date }],
queryFn: () => trpc.mboard.getWeekMissions.query({ date: date }),
}))
}

export default useWeekViewMissions
23 replies
SSolidJS
Created by DUF on 7/11/2024 in #support
Continuos refetches using Solid tanstack, / Reactivity logic?
23 replies