79706146

Date: 2025-07-18 12:11:29
Score: 2
Natty:
Report link

Why not just put cache variable outside react code, and have inside
validUntilDate: ..
data: ..

And then you can serve cache.data if validUntilDate is < Date.now(), otherwise fetch again and populate with new data & date

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Starts with a question (0.5): Why not
  • Low reputation (0.5):
Posted by: Ilija Lončarević