@fougere/state-session
A caller's state kept in a session — what state: { cart: { session: {} } } names: one cookie holds a reference, the values a row in a source.
Use it
npm install @fougere/state-session
pnpm add @fougere/state-session
bun add @fougere/state-session
yarn add @fougere/state-session
// fougere.config.ts
import '@fougere/state-session';
export default defineFougere({
state: { cart: { session: {} } },
});
The import is what makes the word exist: without it, the editor and the boot both refuse it.
Every key each one admits: states.
What it extends
The interfaces of Fougere this package adds its words to, with declare module — see Interfaces to extend.
| interface | adds |
|---|---|
FougereStates | session |
Entries: @fougere/state-session
What you import
| name | |
|---|---|
StateSession | The values a caller keeps in its session, by name — each one signed, as it would have left. |
Types
TypeScript types only — they do not run. Import them with import type to type your own code: a variable, a parameter, an option object.
| name | |
|---|---|
SessionOptions |