MCPcopy Create free account
hub / github.com/triggerdotdev/trigger.dev / useOptionalJob

Function useOptionalJob

apps/webapp/app/hooks/useJob.tsx:13–24  ·  view source on GitHub ↗
(matches?: UIMatch[])

Source from the content-addressed store, hash-verified

11 "routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam";
12
13export function useOptionalJob(matches?: UIMatch[]) {
14 const routeMatch = useTypedMatchesData<typeof loader>({
15 id: jobMatchId,
16 matches,
17 });
18
19 if (!routeMatch) {
20 return undefined;
21 }
22
23 return routeMatch.job;
24}
25
26export function useJob(matches?: UIMatch[]) {
27 const job = useOptionalJob(matches);

Callers 1

useJobFunction · 0.85

Calls 1

useTypedMatchesDataFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…