export const useFetchDataScreen = (id:number):any => {
const assignDataFn = (id: number) => {
return queryOptions({
queryKey: ['assignKey',id],
queryFn: () => getAssign(id),
enabled:!!id
})
}
const getRoles = () => {
return queryOptions({
queryKey: ['getRoleUser],
queryFn: () => getRolesUser(),
enabled:!!roleId
})
}
return useQueries({
queries: [assignDataFn(id), getRoles() ],
combine:([{data:permissionOfRoles}, roles, allPermissions])=> {
//// logic and return data
},
})
};
export const useAssignRoleForPermission = (roleId:number) =>
return useMutation({
mutationFn: (payload:any) => postFn(payload),
mutationKey:['post_fn_key'],
onSuccess:() => {
// i need call useFetchDataScreen in here
}
})
}
https://x.com/tan_stack/status/2031128535470104577?s=20
dry-scarlet · 10h ago
https://x.com/powersync_/status/2010721010006552775?s=20
dry-scarlet · 2mo ago
You can now submit your website/app/project to http://TanStack.com 's new showcase and have it seen by the TanStack community! - Global showcase browser - Per-library filters - Category filters Submit here: https://tanstack.com/showcase/submit View all here: https://tanstack.com/showcase
dry-scarlet · 3mo ago