@fougere/state-cookie
A caller's state kept in a cookie — what state: { cart: { cookie: {} } } names, signed by core, carried by every HTTP door.
Use it
npm install @fougere/state-cookie
pnpm add @fougere/state-cookie
bun add @fougere/state-cookie
yarn add @fougere/state-cookie
// fougere.config.ts
import '@fougere/state-cookie';
export default defineFougere({
state: { cart: { cookie: {} } },
});
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 | cookie |
Entries: @fougere/state-cookie
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 | |
|---|---|
CookieOptions |