CRUD / foldkit-crud

What it owns, and what it does not

FactOwner
The records, and whether a save or delete is pending, applied or failedRemote, in its store
What a record is: its members, labels and relationsthe Entity
The drafts, and whether they are validthe form
Which id is open or being asked about, and which request is this screen'sthe editor or remover, in its slice of your Model
Which rows a list shows: search, sort, filtersyour Model, as the query's input
What happens after a save or delete: navigate, close, a toastyour application, reading the piece's status
How it looksyou, or foldkit-mixins-crud and foldkit-mixins-form

The mental model

your Model says what is on screen
   ──▶ each piece's `active`: what it requires of Remote
   ──▶ Data.wiring ──▶ Remote fetches and retains it

Remote's store ──▶ each piece reads it: a page, a value, a status ──▶ your view

the user acts ──▶ a Message ──▶ a piece's helper, or the editor's onOut
   ──▶ Data.mutate ──▶ Remote settles it ──▶ the status moves

The rule to remember: a piece loads only what its active requires, and only if that active is wired. A piece that is not wired never loads, and nothing reports it. Wiring a page gathers every piece's active so none is left out.

Install

sh
pnpm add effect foldkit foldkit-crud foldkit-bundle foldkit-entity foldkit-form foldkit-remote foldkit-surface