Skip to content
Discussion options

You must be logged in to vote

From the top of my head, untested: Make sure to pass a current timestamp to each loader's Response:

type LoaderData = {
  timestamp: number;
  // Your API response, including:
  rateLimit: RateLimit;
};

// simplified, adapt to your actual implementation:
export const loader: LoaderFunction = async () => {
  const githubData = await getGithubData();
  // Of course, this timestamp represents the point in time
  // you _received_ the API response and not the moment
  // it was sent. Might be good enough for your use case.
  const timestamp = new Date().getTime();
  
  return json<LoaderData>({
    ...githubData,
    timestamp, 
  });
};

Then, in the component that renders your footer, find …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@machour
Comment options

machour Jan 13, 2022
Maintainer Author

Answer selected by machour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants