mirror of
https://github.com/sr229/kuru-kuru.git
synced 2024-09-20 04:10:33 +00:00
238c01bcd7
Update globalCount type from number to bigint in CounterCard and index files, and in setGlobalStatistics function
11 lines
317 B
TypeScript
11 lines
317 B
TypeScript
const kv = await Deno.openKv();
|
|
|
|
export async function getGlobalStatistics() {
|
|
const res = await kv.get<bigint>(["global-statistics"])!;
|
|
return res.value!;
|
|
}
|
|
|
|
export async function setGlobalStatistics(value: bigint) {
|
|
const pv = await getGlobalStatistics();
|
|
await kv.set(["global-statistics"], pv + value);
|
|
}
|