(updatedAt: number, staleTime?: number)
| 155 | * @returns The remaining time in milliseconds, or `0` if the data is already stale. |
| 156 | */ |
| 157 | export function timeUntilStale(updatedAt: number, staleTime?: number): number { |
| 158 | return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0) |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * Resolves an option that can be given either as a value or as a function of the query, such as |
no outgoing calls
no test coverage detected