mirror of
https://github.com/sr229/kuru-kuru.git
synced 2024-09-20 04:10:33 +00:00
41be1559f1
* refactor: Update dependencies and refactor code
Removed axios-web and replaced with BroadcastChannel and WebSocket for counter and global count functionalities.
* feat: Update CounterCard and routes
Update CounterCard timeout and routes POST method
* Debug socket message
* ensure value is always treated as a BigInt internally
* Frogot to put it below that 💀
* Move type conversion to database
* I swear if this doesnt work im going to choke someone
* assign converted value to a variable
SURELY this will work right?
* Revert db to use numbers again
11 lines
317 B
TypeScript
11 lines
317 B
TypeScript
const kv = await Deno.openKv();
|
|
|
|
export async function getGlobalStatistics() {
|
|
const res = await kv.get<number>(["global-statistics"])!;
|
|
return res.value!;
|
|
}
|
|
|
|
export async function setGlobalStatistics(value: number) {
|
|
const pv = await getGlobalStatistics();
|
|
await kv.set(["global-statistics"], pv + value);
|
|
}
|