re-frame.fresco.forms¶
The optional forms module: one view that keeps an app-db draft in front of a committed value, and decides at commit time whether the commit still belongs to the edit the user made.
Nothing new sits underneath it. The draft is an h/reg-state concern, the reset
is ::h/revision, the protocol is three ordinary events, and the field is one
h/defview boundary — so the module costs no hook beyond the shell's own, and an
application that never requires this namespace carries none of it.
This page is the manifest-tracked index of the module's public vars. The prop table, the rejection rule and the recipes the module deliberately leaves to the application live in Forms and the Fresco API reference.
The field¶
buffered-field¶
- Kind: Var (view)
- Signature:
- Description: A controlled
<input>with an app-db draft in front of the committed value.:controlis an opaque address, not a path;:valueis the committed value;::h/revisionis the caller's generation counter and is what a rejection is made of.:value,:on-commit,:on-cancel,:keyand::h/revisionare the field's own — every other prop reaches the<input>unchanged, with:typedefaulting to"text".- The protocol is three ordinary events in the module's own keyword namespace
(
::editon:on-input,::commiton Enter and blur alike,::cancelon Escape), written into the field's intents rather than exported as names. A test that drives the field by hand spells them throughre-frame.fresco.test.forms. - It mints no refusal id of its own: a bad
:controlisreg-state's:rf.error/fresco-state-bad-argumentat the field's first render, and::h/revisionon a non-text field is:rf.error/fresco-revision-not-controlled.
- The protocol is three ordinary events in the module's own keyword namespace
(
- Example:
The draft's home¶
drafts¶
- Kind: Var
- Signature:
- Description: The
h/reg-stateconcern every buffered draft lives under, and the address an application clears to end one — route entry, an explicit cancel, a successful save reply. The value under one control is{:revision r :draft text}; absence means no editing session, and it is the only spelling of none, which is what makes every repeated commit idempotent. A draft survives re-render, remount, virtualization and navigation on purpose, so ending one is the application's call. - Example:
See also¶
- Forms — the chapter that governs the surface
- Fresco API reference — the full contract
re-frame.fresco— the door, includingh/reg-stateand::h/revision