-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d4d365e
commit a319278
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
|
||
|
||
export function getTimeMillisRounded() { | ||
// NOTE: When we use this, it's a little bit hacky. | ||
// First off, we still have to explicitly tell our client to have a refetch interval because this is not a hook. | ||
// Second off, if that fetch takes longer than 10 seconds, this will update in that time, causing an immediate refetch. | ||
const currentTimeMillis = Date.now(); | ||
return Math.ceil(currentTimeMillis / 10_000) * 10_000; | ||
} |