CRUD / foldkit-crud
Detail
Crud.detail reads one record through a Selection without holding local state:
ts
const PostDetail = Crud.detail('PostDetail', { selection: PostPage }).at({
data: Data,
id: model => Option.fromNullOr(model.shownPostId), // none while none is shown
})
PostDetail.value(model) // RemoteData of the Selection's valueCrud.detail(...).fields lists the selected members with labels,
PostDetail.active retains and fetches the record while an ID is shown, and
PostDetail.refresh(model) marks it for refetching.