Untitled

 avatar
unknown
plain_text
23 days ago
888 B
3
Indexable
ts
type ItemT = {
      id: crypto.randomUUID(),
      desc: 'Do weekly shopping',
      status: 'not started',
      estimate: 2,
    }

export function fetchItems(): {
  // do not modify
  const duration = Math.round(Math.random() * (1250 - 500) + 500);
  const data = [
    {
      id: crypto.randomUUID(),
      desc: 'Do weekly shopping',
      status: 'not started',
      estimate: 2,
    },
    {
      id: crypto.randomUUID(),
      desc: 'Call bank regarding credit card',
      status: 'in progress',
      estimate: 4,
    },
    {
      id: crypto.randomUUID(),
      desc: 'Follow up on requirements',
      status: 'not started',
      estimate: 2,
    },
    {
      id: crypto.randomUUID(),
      desc: 'Prepare proof of concept',
      status: 'done',
      estimate: 1,
    },
  ];
  return new Promise((resolve) =>
    setTimeout(() => resolve(data), duration),
  );
}
Leave a Comment