1
2
3
4
5
6
7
8
9
10
11
12
13
import { blob } from "https://esm.town/v/std/blob";
const KEY = "blob_counter";
const oldState = await blob.getJSON(KEY) ?? 0;
console.log("Old value", oldState);
await blob.setJSON(KEY, oldState + 1);
const newState = await blob.getJSON(KEY);
console.log("New value", newState);
export let docsBlobCounterDemo = undefined;
๐Ÿ‘† This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data โ€” all from the browser.