TurboWarp Jotai Adapter

This TurboWarp extension describes Jotai atom registry, action envelope, and state snapshot JSON. It is a bridge contract, not a bundled Jotai runtime.

Load the extension

Load dist/turbowarp-jotai-adapter.js as the TurboWarp custom extension. The existing jotai-bridge library entry remains separate.

jsDelivr standalone bundle ยท unpkg standalone bundle

Intended role

Use blocks for declarative state descriptions, then pass the generated JSON to a React/Jotai host that validates and applies it with TypeScript hooks.

Documents

TurboWarp Jotai Adapter: complete block reference

All 7 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.

define Jotai atom [ATOM] default JSON [VALUE]

Adds or replaces an atom definition in the current bridge plan.

Block type: COMMAND. Opcode: defineAtom. Permanent link

ArgumentTypeDefault valueMenu choices
ATOMSTRINGcounter
VALUESTRING0

set Jotai atom [ATOM] JSON [VALUE]

Updates the current atom snapshot and appends a set-atom action envelope.

Block type: COMMAND. Opcode: setAtomValue. Permanent link

ArgumentTypeDefault valueMenu choices
ATOMSTRINGcounter
VALUESTRING1

Jotai atom [ATOM] value JSON

Returns the current JSON value for an atom in the bridge plan.

Block type: REPORTER. Opcode: atomValueJson. Permanent link

ArgumentTypeDefault valueMenu choices
ATOMSTRINGcounter

Jotai set action atom [ATOM] JSON [VALUE]

Returns a standalone set-atom action envelope as JSON.

Block type: REPORTER. Opcode: createSetActionJson. Permanent link

ArgumentTypeDefault valueMenu choices
ATOMSTRINGcounter
VALUESTRING1

Jotai bridge plan JSON

Returns the current atom registry, action log, and state snapshot as bridge JSON.

Block type: REPORTER. Opcode: planJson. Permanent link

This block has no arguments.

clear Jotai bridge plan

Clears the in-memory bridge plan held by this TurboWarp extension instance.

Block type: COMMAND. Opcode: clearPlan. Permanent link

This block has no arguments.

normalized JSON [VALUE]

Parses a JSON value and returns its canonical JSON representation.

Block type: REPORTER. Opcode: normalizeValueJson. Permanent link

ArgumentTypeDefault valueMenu choices
VALUESTRING{"label":"demo"}

Repository guide and examples