Web
Web Storage Value
createWebStorageValue()
Creates a reactive handle for a localStorage or sessionStorage instance.
Examples
Vanilla
import { } from 'seitu/web'
import * as from 'zod'
const = ({
: 'sessionStorage',
: {
: .().(),
: .({ : .(['light', 'dark']) }),
},
: { : null, : { : 'light' } },
})
.() // { token: null, preferences: { theme: 'light' } }
.({ : 'abc' })
.() // { token: 'abc', preferences: { theme: 'light' } }
.(.)React
'use client'
import { } from 'seitu/web'
import { } from 'seitu/react'
import * as from 'zod'
const = ({
: 'sessionStorage',
: { : .(), : .() },
: { : 0, : '' },
})
export default function () {
const = ()
return (
<>
<>{.}</>
<>{.}</>
</>
)
}