Web
Session Storage Value
sessionStorageValue()
Creates a reactive handle for a single sessionStorage value.
Two modes:
- Schema mode (
schema,key,defaultValue): standalone key with validation. Missing or invalid stored data returnsdefaultValue. - Storage mode (
storage,key): binds to one key of acreateSessionStorageinstance. Type and default come from that storage.
Example
import { } from 'seitu/web'
import * as from 'zod'
const = ({
: 'count',
: 0,
: .(),
})
.() // 0
.(1)
.( => + 1)
.()
.( => .())Example
import { , } from 'seitu/web'
import * as from 'zod'
const = ({
: { : .(), : .() },
: { : 0, : '' },
})
const = ({ , : 'count' })
.(5)
.(). === 5 // true