mirror of
https://github.com/sr229/kuru-kuru.git
synced 2024-09-20 04:10:33 +00:00
51556f2c9f
Signed-off-by: Ayase Minori <chinodesuuu@gmail.com>
17 lines
366 B
TypeScript
17 lines
366 B
TypeScript
const kv = await Deno.openKv();
|
|
|
|
export function getGlobalStatistics(): number {
|
|
let res = 0;
|
|
kv.get<number>(["global-statistics"]).then(v => {
|
|
res = v.value as number;
|
|
});
|
|
|
|
return res;
|
|
}
|
|
|
|
export function setGlobalStatistics(value: number) {
|
|
const pv = getGlobalStatistics();
|
|
kv.set(["global-statistics"], pv + value).then(() => {
|
|
return;
|
|
})
|
|
}
|