MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / useUser

Function useUser

apps/webapp/app/hooks/useUser.ts:16–24  ·  view source on GitHub ↗
(matches?: UIMatch[])

Source from the content-addressed store, hash-verified

14}
15
16export function useUser(matches?: UIMatch[]): User {
17 const maybeUser = useOptionalUser(matches);
18 if (!maybeUser) {
19 throw new Error(
20 "No user found in root loader, but user is required by useUser. If user is optional, try useOptionalUser instead."
21 );
22 }
23 return maybeUser;
24}
25
26export function useUserChanged(callback: (user: User | undefined) => void) {
27 useChanged(useOptionalUser, callback);

Callers 15

RequestV3AccessFunction · 0.90
AdminDashboardRouteFunction · 0.90
PageFunction · 0.90
OrganizationFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90

Calls 1

useOptionalUserFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…