Job BoardLoading saved progress…

Job Board

Build a job board that fetches postings and loads more on demand. The shape is paginated fetching: keep the jobs loaded so far, and a "Load more" button that requests the next slice and appends it. While a request is in flight, show a loading state; when everything's loaded, retire the button.

Signature

type Job = { id: number; title: string; company: string };
function fetchJobs(offset: number, limit: number): Promise<Job[]>;

// A self-contained component. No props.
function App(): JSX.Element;

Examples

mount → fetchJobs(0, 5) → first 5 jobs, loading shown meanwhile
"Load more" → fetchJobs(5, 5) → next 5 appended below the first 5
when fewer than `limit` come back (or total reached) → no more pages → hide the button

Notes

  • Append, don't replace. New pages add to the existing list: [...jobs, ...more].
  • Offset = current length. Request the next slice starting where you are.
  • Loading flag. Disable "Load more" while fetching so you don't double-request.
  • Know when to stop. Hide the button once you've loaded everything (short page or total reached).
Loading editor…
Loading preview…