• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
novari

novari

persistentSignal

Public
Like
persistentSignal
Home
Code
2
README.md
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
Code
/
Search
README.md

persistentSignal

usage:

import setupPersistentSignal from "https://esm.town/v/novari/persistentSignal";
import signals from "https://esm.sh/@preact/signals"; // or any other compatible library like @preact/signals-core, @preact/signals-react etc
import { useLiveSignal } from "https://esm.sh/@preact/signals/utils"; // if you want to use your persistent signals as local signals

const persistentSignal = setupPersistentSignal(signals);

const userName = persistentSignal("username", "USERNAME-UNKNOWN"); //uses localStorage, so all values are turned into strings

function App(){
  const user = useLiveSignal(userName);
  if (user == "USERNAME-UNKNOWN") return ( <RequestName signal={user}/> );
  else return ( <Greeting signal={user}/> );
}

(in theory, idk what's up with the random v3.module.town and esm.town/x/ and esm.town/v/ etc etc)

Code
README.mdmain.tsx
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.