consequitur-render
v0.3.2
Published
A consequitur reading made into DOM.
Readme
consequitur-render
A consequitur reading made into DOM: a small toolkit, not a view layer.
The screen is a deduction from the thread, its reading and the draft: nothing is observed and nothing is read back from the DOM. This package draws no card and owns no markup or style; the application builds every node. It keeps nodes, schedules previews and draws a pointer line, the three things every screen of a thread needed and that are easy to get wrong.
npm install consequitur-render consequiturlineFacts(lines, reading, schema): each line's facts, in reading order: in force, revoked by, its goal's reading, what wrote it (pure, no DOM);changes(before, after): what a reading changed into, line by line (pure);keyed: nodes kept by line id, rebuilt only when their key changes;previewer: the debounced dry run while a draft is composed, with stale answers dropped and a failed run told toonError;band: the pointer line over a layer, a drag from a slot to a line.
import { consequitur } from 'consequitur';
import { lineFacts } from 'consequitur-render';
const reading = consequitur(state.lines, state.handles, schema);
for (const facts of lineFacts(state.lines, reading, schema)) {
// facts.line, facts.inForce, facts.revokedBy, facts.goal …
}Its one dependency is consequitur. keyed, previewer and band touch the DOM and take it as an argument or from document.
Documents
The documents are in five shelves: tutorial, how-to guides, reference, explanation and project, all in docs/ of the repository.
MIT.
