Unlisted
Like
counter
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v1View latest version
counter: simple counter that autosaves with @postpostscript/reactiveStateBlob
using viewCount = await counter();
viewCount.value += 1;
This infers the key from the name of the val that uses it. To specify it, pass the key option:
using viewCount = await counter({ key: "counterExample.viewCount" })
Full Example: @postpostscript/counterExample
Migrated from folder: State/counter