Skip to main content

Stayte

The persistent state library for the modern web

Index.tsx
import { gluon } from "stayte";
import { useGluon } from "stayte/react";

const countGluon = gluon('count', {
from: 'query',
defaultValue: 10
})

const Counter = () => {
const count = useGluon(countGluon)

return <button onClick={() => count.value++}>
count: {count.value}
</button>
}

Click here and watch the url !

Signal-Like

Gluon is inspired by the signal concept, you can subscribe to a gluon and get notified when it changes

Peristent State

Create peristent state with ease by using cookies, query, local storage or session storage

Type-Safe

Fully typed library, smart enough to infer the type of your gluon

SSR Friendly

Gluon can work with SSR just by applying a simple patch

Fully Tested

Unit tests is runned on every commit and every pull request

Zod Validation

Zod is used to validate the default value and every new value set by the user of the gluon