global: snapshot

This commit is contained in:
nym21
2026-01-20 23:05:21 +01:00
parent 9613fce919
commit 2edd9ed2d7
33 changed files with 1020 additions and 1108 deletions

View File

@@ -87,7 +87,7 @@ function useMetricEndpoint(endpoint) {
* @param {number} [to]
* @returns {RangeState<T>}
*/
function range(from, to) {
function range(from = -10000, to) {
const key = `${from}-${to ?? ""}`;
const existing = ranges.get(key);
if (existing) return existing;
@@ -111,7 +111,7 @@ function useMetricEndpoint(endpoint) {
* @param {number} [start=-10000]
* @param {number} [end]
*/
async fetch(start, end) {
async fetch(start = -10000, end) {
const r = range(start, end);
r.loading.set(true);
try {