Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function useUserTasksForCurrentUser(
include?: string[]
): {
error: Error;
isLoading: boolean;
userTasks: UserTaskResource[];
} {
useLiveData('user-tasks');
const { error, isLoading } = useUserTasksList(include);
const { currentUser } = useCurrentUser();
const {
subscriptions: { userTasks },
} = useCache({
userTasks: (q) => q.findRecords('userTask').filter({ relation: 'user', record: currentUser }),
});
return { error, isLoading, userTasks: userTasks || [] };
}